Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ath9k: remove ath9k_mod_tsf64_tu

Remove ath9k_mod_tsf64_tu() function while we could
use div_u64_rem() function.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>

authored by

Janusz Dziedzic and committed by
Kalle Valo
05a85a6c 02edab5b

+4 -18
+4 -18
drivers/net/wireless/ath/ath9k/common-beacon.c
··· 18 18 19 19 #define FUDGE 2 20 20 21 - /* Calculate the modulo of a 64 bit TSF snapshot with a TU divisor */ 22 - static u32 ath9k_mod_tsf64_tu(u64 tsf, u32 div_tu) 23 - { 24 - u32 tsf_mod, tsf_hi, tsf_lo, mod_hi, mod_lo; 25 - 26 - tsf_mod = tsf & (BIT(10) - 1); 27 - tsf_hi = tsf >> 32; 28 - tsf_lo = ((u32) tsf) >> 10; 29 - 30 - mod_hi = tsf_hi % div_tu; 31 - mod_lo = ((mod_hi << 22) + tsf_lo) % div_tu; 32 - 33 - return (mod_lo << 10) | tsf_mod; 34 - } 35 - 36 21 static u32 ath9k_get_next_tbtt(struct ath_hw *ah, u64 tsf, 37 22 unsigned int interval) 38 23 { 39 - unsigned int offset; 24 + unsigned int offset, divisor; 40 25 41 26 tsf += TU_TO_USEC(FUDGE + ah->config.sw_beacon_response_time); 42 - offset = ath9k_mod_tsf64_tu(tsf, interval); 27 + divisor = TU_TO_USEC(interval); 28 + div_u64_rem(tsf, divisor, &offset); 43 29 44 - return (u32) tsf + TU_TO_USEC(interval) - offset; 30 + return (u32) tsf + divisor - offset; 45 31 } 46 32 47 33 /*