Skip to content

Commit 8b0f925

Browse files
jmberg-intellucacoelho
authored andcommitted
iwlwifi: mvm: fix 32-bit build in FTM
On a 32-bit build, the division here needs to be done using do_div(), otherwise the compiler will try to call a function that doesn't exist, thus failing to build. Fixes: b68bd2e ("iwlwifi: mvm: Add FTM initiator RTT smoothing logic") Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20211219111352.e56cbf614a4d.Ib98004ccd2c7a55fd883a8ea7eebd810f406dec6@changeid Signed-off-by: Luca Coelho <[email protected]>
1 parent 4cd177b commit 8b0f925

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,8 @@ static void iwl_mvm_ftm_rtt_smoothing(struct iwl_mvm *mvm,
10661066
overshoot = IWL_MVM_FTM_INITIATOR_SMOOTH_OVERSHOOT;
10671067
alpha = IWL_MVM_FTM_INITIATOR_SMOOTH_ALPHA;
10681068

1069-
rtt_avg = (alpha * rtt + (100 - alpha) * resp->rtt_avg) / 100;
1069+
rtt_avg = alpha * rtt + (100 - alpha) * resp->rtt_avg;
1070+
do_div(rtt_avg, 100);
10701071

10711072
IWL_DEBUG_INFO(mvm,
10721073
"%pM: prev rtt_avg=%lld, new rtt_avg=%lld, rtt=%lld\n",

0 commit comments

Comments
 (0)