Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 35a0ace7 authored by Roel Kluin's avatar Roel Kluin Committed by John W. Linville
Browse files

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: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarPavel Roskin <proski@gnu.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 1795378e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -469,7 +469,7 @@ int hermes_read_ltv(hermes_t *hw, int bap, u16 rid, unsigned bufsize,
	u16 rlength, rtype;
	u16 rlength, rtype;
	unsigned nwords;
	unsigned nwords;


	if ((bufsize < 0) || (bufsize % 2))
	if (bufsize % 2)
		return -EINVAL;
		return -EINVAL;


	err = hermes_docmd_wait(hw, HERMES_CMD_ACCESS, rid, NULL);
	err = hermes_docmd_wait(hw, HERMES_CMD_ACCESS, rid, NULL);
+1 −1
Original line number Original line Diff line number Diff line
@@ -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);
				(ieee80211_get_tx_rate(dev, info)->bitrate * 2) / 10);
		remainder = (16 * (skb->len + 4)) %
		remainder = (16 * (skb->len + 4)) %
			    ((ieee80211_get_tx_rate(dev, info)->bitrate * 2) / 10);
			    ((ieee80211_get_tx_rate(dev, info)->bitrate * 2) / 10);
		if (remainder > 0 && remainder <= 6)
		if (remainder <= 6)
			plcp_len |= 1 << 15;
			plcp_len |= 1 << 15;
	}
	}