]> git.baikalelectronics.ru Git - kernel.git/commit
iwlwifi: fix 64-bit division
authorArnd Bergmann <arnd@arndb.de>
Mon, 4 Mar 2019 20:38:42 +0000 (21:38 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 7 Mar 2019 17:15:06 +0000 (19:15 +0200)
commit9829448d65a81c472030d14a3a6e0f9a5575d36f
treeec849e3748341c246fbe233b33461e48033fe738
parent225af1dcd7eac2d8ae009d0500311bf4b9dd9b83
iwlwifi: fix 64-bit division

do_div() expects unsigned operands and otherwise triggers a warning like:

drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c:465:2: error: comparison of distinct pointer types ('typeof ((rtt_avg)) *' (aka 'long long *') and 'uint64_t *' (aka 'unsigned long long *')) [-Werror,-Wcompare-distinct-pointer-types]
        do_div(rtt_avg, 6666);
        ^~~~~~~~~~~~~~~~~~~~~
include/asm-generic/div64.h:222:28: note: expanded from macro 'do_div'
        (void)(((typeof((n)) *)0) == ((uint64_t *)0));  \
               ~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~
1 error generated.

Change the do_div() to the simpler div_s64() that can handle
negative inputs correctly.

Fixes: 273a5c5c9f70 ("iwlwifi: mvm: add debug prints for FTM")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c