Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

wireless: remove redundant tests on unsigned

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>

authored by

Roel Kluin and committed by
John W. Linville
35a0ace7 1795378e

+2 -2
+1 -1
drivers/net/wireless/orinoco/hermes.c
··· 469 469 u16 rlength, rtype; 470 470 unsigned nwords; 471 471 472 - if ((bufsize < 0) || (bufsize % 2)) 472 + if (bufsize % 2) 473 473 return -EINVAL; 474 474 475 475 err = hermes_docmd_wait(hw, HERMES_CMD_ACCESS, rid, NULL);
+1 -1
drivers/net/wireless/rtl818x/rtl8180_dev.c
··· 281 281 (ieee80211_get_tx_rate(dev, info)->bitrate * 2) / 10); 282 282 remainder = (16 * (skb->len + 4)) % 283 283 ((ieee80211_get_tx_rate(dev, info)->bitrate * 2) / 10); 284 - if (remainder > 0 && remainder <= 6) 284 + if (remainder <= 6) 285 285 plcp_len |= 1 << 15; 286 286 } 287 287