aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/broadcom/brcm80211
diff options
context:
space:
mode:
authorStefan Agner <stefan@agner.ch>2018-06-17 12:33:50 +0200
committerKalle Valo <kvalo@codeaurora.org>2018-06-27 18:56:33 +0300
commitc9a61469fc97672a08b2f798830a55ea6e03dc4a (patch)
treed9622de69a7e6f61d10ce681e87fb46faf935a7a /drivers/net/wireless/broadcom/brcm80211
parentbrcmsmac: Remove unnecessary parentheses (diff)
downloadlinux-dev-c9a61469fc97672a08b2f798830a55ea6e03dc4a.tar.xz
linux-dev-c9a61469fc97672a08b2f798830a55ea6e03dc4a.zip
brcmsmac: fix wrap around in conversion from constant to s16
The last value in the log_table wraps around to a negative value since s16 has a value range of -32768 to 32767. This is not what the table intends to represent. Use the closest positive value 32767. This fixes a warning seen with clang: drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_qmath.c:216:2: warning: implicit conversion from 'int' to 's16' (aka 'short') changes value from 32768 to -32768 [-Wconstant-conversion] 32768 ^~~~~ 1 warning generated. Fixes: 4c0bfeaae9f9 ("brcmsmac: fix array out-of-bounds access in qm_log10") Cc: Tobias Regnery <tobias.regnery@gmail.com> Signed-off-by: Stefan Agner <stefan@agner.ch> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/broadcom/brcm80211')
-rw-r--r--drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_qmath.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_qmath.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_qmath.c
index b9672da24a9d..b24bc57ca91b 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_qmath.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_qmath.c
@@ -213,7 +213,7 @@ static const s16 log_table[] = {
30498,
31267,
32024,
- 32768
+ 32767
};
#define LOG_TABLE_SIZE 32 /* log_table size */