diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2016-10-06 09:40:14 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-10-17 11:25:23 -0400 |
commit | 1b203c138c5a0d78aa34d1c4346ff6b32ac74869 (patch) | |
tree | 99870d3fe1eb6268bfcd13afead032d55c2d727f | |
parent | 6d3a4c404648e415e7d96e285d723936d4df7ed0 (diff) |
netfilter: xt_hashlimit: Add missing ULL suffixes for 64-bit constants
On 32-bit (e.g. with m68k-linux-gnu-gcc-4.1):
net/netfilter/xt_hashlimit.c: In function ‘user2credits’:
net/netfilter/xt_hashlimit.c:476: warning: integer constant is too large for ‘long’ type
...
net/netfilter/xt_hashlimit.c:478: warning: integer constant is too large for ‘long’ type
...
net/netfilter/xt_hashlimit.c:480: warning: integer constant is too large for ‘long’ type
...
net/netfilter/xt_hashlimit.c: In function ‘rateinfo_recalc’:
net/netfilter/xt_hashlimit.c:513: warning: integer constant is too large for ‘long’ type
Fixes: 11d5f15723c9f39d ("netfilter: xt_hashlimit: Create revision 2 to support higher pps rates")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Vishwanath Pai <vpai@akamai.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | net/netfilter/xt_hashlimit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index 2fab0c65aa94..b89b688e9d01 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c | |||
@@ -431,7 +431,7 @@ static void htable_put(struct xt_hashlimit_htable *hinfo) | |||
431 | CREDITS_PER_JIFFY*HZ*60*60*24 < 2^32 ie. | 431 | CREDITS_PER_JIFFY*HZ*60*60*24 < 2^32 ie. |
432 | */ | 432 | */ |
433 | #define MAX_CPJ_v1 (0xFFFFFFFF / (HZ*60*60*24)) | 433 | #define MAX_CPJ_v1 (0xFFFFFFFF / (HZ*60*60*24)) |
434 | #define MAX_CPJ (0xFFFFFFFFFFFFFFFF / (HZ*60*60*24)) | 434 | #define MAX_CPJ (0xFFFFFFFFFFFFFFFFULL / (HZ*60*60*24)) |
435 | 435 | ||
436 | /* Repeated shift and or gives us all 1s, final shift and add 1 gives | 436 | /* Repeated shift and or gives us all 1s, final shift and add 1 gives |
437 | * us the power of 2 below the theoretical max, so GCC simply does a | 437 | * us the power of 2 below the theoretical max, so GCC simply does a |
@@ -473,7 +473,7 @@ static u64 user2credits(u64 user, int revision) | |||
473 | return div64_u64(user * HZ * CREDITS_PER_JIFFY_v1, | 473 | return div64_u64(user * HZ * CREDITS_PER_JIFFY_v1, |
474 | XT_HASHLIMIT_SCALE); | 474 | XT_HASHLIMIT_SCALE); |
475 | } else { | 475 | } else { |
476 | if (user > 0xFFFFFFFFFFFFFFFF / (HZ*CREDITS_PER_JIFFY)) | 476 | if (user > 0xFFFFFFFFFFFFFFFFULL / (HZ*CREDITS_PER_JIFFY)) |
477 | return div64_u64(user, XT_HASHLIMIT_SCALE_v2) | 477 | return div64_u64(user, XT_HASHLIMIT_SCALE_v2) |
478 | * HZ * CREDITS_PER_JIFFY; | 478 | * HZ * CREDITS_PER_JIFFY; |
479 | 479 | ||