wireless-drivers: use BIT_ULL for NL80211_STA_INFO_ attribute types
The BIT macro uses unsigned long which some architectures handle as 32 bit and therefore might cause macro's shift to overflow when used on a value equals or larger than 32 (NL80211_STA_INFO_RX_DURATION and afterwards). Since 'filled' member in station_info changed to u64, BIT_ULL macro should be used with all NL80211_STA_INFO_* attribute types instead of BIT to prevent future possible bugs when one will use BIT macro for higher attributes by mistake. This commit cleans up all usages of BIT macro with the above field in wireless-drivers by changing it to BIT_ULL instead. In addition, there are some places which don't use BIT nor BIT_ULL macros so align those as well. Signed-off-by: Omer Efrat <omer.efrat@tandemg.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
这个提交包含在:
@@ -4216,7 +4216,7 @@ static void iwl_mvm_mac_sta_statistics(struct ieee80211_hw *hw,
|
||||
|
||||
if (mvmsta->avg_energy) {
|
||||
sinfo->signal_avg = mvmsta->avg_energy;
|
||||
sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL_AVG);
|
||||
sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL_AVG);
|
||||
}
|
||||
|
||||
if (!fw_has_capa(&mvm->fw->ucode_capa,
|
||||
@@ -4240,11 +4240,11 @@ static void iwl_mvm_mac_sta_statistics(struct ieee80211_hw *hw,
|
||||
|
||||
sinfo->rx_beacon = mvmvif->beacon_stats.num_beacons +
|
||||
mvmvif->beacon_stats.accu_num_beacons;
|
||||
sinfo->filled |= BIT(NL80211_STA_INFO_BEACON_RX);
|
||||
sinfo->filled |= BIT_ULL(NL80211_STA_INFO_BEACON_RX);
|
||||
if (mvmvif->beacon_stats.avg_signal) {
|
||||
/* firmware only reports a value after RXing a few beacons */
|
||||
sinfo->rx_beacon_signal_avg = mvmvif->beacon_stats.avg_signal;
|
||||
sinfo->filled |= BIT(NL80211_STA_INFO_BEACON_SIGNAL_AVG);
|
||||
sinfo->filled |= BIT_ULL(NL80211_STA_INFO_BEACON_SIGNAL_AVG);
|
||||
}
|
||||
unlock:
|
||||
mutex_unlock(&mvm->mutex);
|
||||
|
在新工单中引用
屏蔽一个用户