diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-04-22 05:25:43 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-04-22 16:57:20 -0400 |
commit | 1d4df3a50f40a731fc03c86a76535ed141b0e4bc (patch) | |
tree | 6d0867c4f48a2df93cc6854d33e98d5e8165b0fe /net/mac80211/mlme.c | |
parent | eb1a685e07310b5137c561e25ab738292db2c8a5 (diff) |
mac80211: fix variable truncation on 32-bit
Stephen Rothwell reported these warnings from a 32-bit build:
net/mac80211/mlme.c:1771: warning: left shift count >= width of type
net/mac80211/mlme.c:1772: warning: left shift count >= width of type
net/mac80211/mlme.c:1773: warning: left shift count >= width of type
net/mac80211/mlme.c:1774: warning: left shift count >= width of type
net/mac80211/mlme.c:1775: warning: left shift count >= width of type
This shows a bug in my code -- BIT(X) uses just "1 << X" which means
a 32-bit integer on 32-bit platforms, but the code here needs a u64
on all platforms. Fix this by using "1ULL << X" instead of BIT(X).
Thanks Stephen!
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r-- | net/mac80211/mlme.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 1b0b7aa387ee..e819c02d13f0 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -1743,12 +1743,12 @@ static void ieee80211_rx_mgmt_probe_resp(struct ieee80211_sub_if_data *sdata, | |||
1743 | * look out for other vendor IEs. | 1743 | * look out for other vendor IEs. |
1744 | */ | 1744 | */ |
1745 | static const u64 care_about_ies = | 1745 | static const u64 care_about_ies = |
1746 | BIT(WLAN_EID_COUNTRY) | | 1746 | (1ULL << WLAN_EID_COUNTRY) | |
1747 | BIT(WLAN_EID_ERP_INFO) | | 1747 | (1ULL << WLAN_EID_ERP_INFO) | |
1748 | BIT(WLAN_EID_CHANNEL_SWITCH) | | 1748 | (1ULL << WLAN_EID_CHANNEL_SWITCH) | |
1749 | BIT(WLAN_EID_PWR_CONSTRAINT) | | 1749 | (1ULL << WLAN_EID_PWR_CONSTRAINT) | |
1750 | BIT(WLAN_EID_HT_CAPABILITY) | | 1750 | (1ULL << WLAN_EID_HT_CAPABILITY) | |
1751 | BIT(WLAN_EID_HT_INFORMATION); | 1751 | (1ULL << WLAN_EID_HT_INFORMATION); |
1752 | 1752 | ||
1753 | static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata, | 1753 | static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata, |
1754 | struct ieee80211_mgmt *mgmt, | 1754 | struct ieee80211_mgmt *mgmt, |