diff options
author | Jakub Kicinski <kuba@kernel.org> | 2022-12-12 19:20:37 -0800 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2022-12-13 10:44:02 +0100 |
commit | 7c4a6309e27f411743817fe74a832ec2d2798a4b (patch) | |
tree | 20e8a7028feaadc969dfbc1410ecd56450e9f287 /drivers/bluetooth | |
parent | b11919e1bb7f6f6273f5a33947b8496da2769eb8 (diff) | |
download | linux-7c4a6309e27f411743817fe74a832ec2d2798a4b.tar.gz linux-7c4a6309e27f411743817fe74a832ec2d2798a4b.tar.bz2 linux-7c4a6309e27f411743817fe74a832ec2d2798a4b.zip |
ipvs: fix type warning in do_div() on 32 bit
32 bit platforms without 64bit div generate the following warning:
net/netfilter/ipvs/ip_vs_est.c: In function 'ip_vs_est_calc_limits':
include/asm-generic/div64.h:222:35: warning: comparison of distinct pointer types lacks a cast
222 | (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
| ^~
net/netfilter/ipvs/ip_vs_est.c:694:17: note: in expansion of macro 'do_div'
694 | do_div(val, loops);
| ^~~~~~
include/asm-generic/div64.h:222:35: warning: comparison of distinct pointer types lacks a cast
222 | (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
| ^~
net/netfilter/ipvs/ip_vs_est.c:700:33: note: in expansion of macro 'do_div'
700 | do_div(val, min_est);
| ^~~~~~
first argument of do_div() should be unsigned. We can't just cast
as do_div() updates it as well, so we need an lval.
Make val unsigned in the first place, all paths check that the value
they assign to this variables are non-negative already.
Fixes: 705dd3444081 ("ipvs: use kthreads for stats estimation")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20221213032037.844517-1-kuba@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/bluetooth')
0 files changed, 0 insertions, 0 deletions