wireless: remove redundant tests on unsigned
authorRoel Kluin <roel.kluin@gmail.com>
Mon, 22 Jun 2009 15:42:21 +0000 (17:42 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 10 Jul 2009 19:01:57 +0000 (15:01 -0400)
bufsize and remainder are unsigned. When negative they are wrapped and caught by
the other test.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/orinoco/hermes.c
drivers/net/wireless/rtl818x/rtl8180_dev.c

index f2c918c..1a2fca7 100644 (file)
@@ -469,7 +469,7 @@ int hermes_read_ltv(hermes_t *hw, int bap, u16 rid, unsigned bufsize,
        u16 rlength, rtype;
        unsigned nwords;
 
-       if ((bufsize < 0) || (bufsize % 2))
+       if (bufsize % 2)
                return -EINVAL;
 
        err = hermes_docmd_wait(hw, HERMES_CMD_ACCESS, rid, NULL);
index 47521c5..09f46ab 100644 (file)
@@ -281,7 +281,7 @@ static int rtl8180_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
                                (ieee80211_get_tx_rate(dev, info)->bitrate * 2) / 10);
                remainder = (16 * (skb->len + 4)) %
                            ((ieee80211_get_tx_rate(dev, info)->bitrate * 2) / 10);
-               if (remainder > 0 && remainder <= 6)
+               if (remainder <= 6)
                        plcp_len |= 1 << 15;
        }