Search Linux Wireless

[bug report] mt76: unify wait_for_mac

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Stanislaw Gruszka,

The patch 2735a6dd7df3: "mt76: unify wait_for_mac" from Aug 29, 2018,
leads to the following static checker warning:

    drivers/net/wireless/mediatek/mt76/mt76x02_mac.h:60 mt76x02_wait_for_mac()
    warn: signedness bug returning '(-5)'

drivers/net/wireless/mediatek/mt76/mt76x02_mac.h
    53  static inline bool mt76x02_wait_for_mac(struct mt76_dev *dev)
    54  {
    55          const u32 MAC_CSR0 = 0x1000;
    56          int i;
    57  
    58          for (i = 0; i < 500; i++) {
    59                  if (test_bit(MT76_REMOVED, &dev->state))
    60                          return -EIO;
                                       ^^^^
This is supposed to be true or false.

    61  
    62                  switch (dev->bus->rr(dev, MAC_CSR0)) {
    63                  case 0:
    64                  case ~0:
    65                          break;
    66                  default:
    67                          return true;
    68                  }
    69                  usleep_range(5000, 10000);
    70          }
    71          return false;
    72  }

regards,
dan carpenter



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux