aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/ratelimiter.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-10-03 06:18:45 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-10-03 06:20:48 +0200
commit9eaec6d8f5cba1a95c7072c95d0a13726352aaea (patch)
tree12d7f4829c92bd535543698308466285b4bd8942 /src/ratelimiter.c
parentreceive: simplify message type validation (diff)
downloadwireguard-monolithic-historical-9eaec6d8f5cba1a95c7072c95d0a13726352aaea.tar.xz
wireguard-monolithic-historical-9eaec6d8f5cba1a95c7072c95d0a13726352aaea.zip
global: satisfy bitshift pedantry
Suggested-by: Sultan Alsawaf <sultanxda@gmail.com>
Diffstat (limited to 'src/ratelimiter.c')
-rw-r--r--src/ratelimiter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ratelimiter.c b/src/ratelimiter.c
index c4281e1..0afcdac 100644
--- a/src/ratelimiter.c
+++ b/src/ratelimiter.c
@@ -150,7 +150,7 @@ int ratelimiter_init(void)
* but what it shares in common is that it uses a massive hashtable. So,
* we borrow their wisdom about good table sizes on different systems
* dependent on RAM. This calculation here comes from there. */
- table_size = (totalram_pages > (1 << 30) / PAGE_SIZE) ? 8192 : max_t(unsigned long, 16, roundup_pow_of_two((totalram_pages << PAGE_SHIFT) / (1 << 14) / sizeof(struct hlist_head)));
+ table_size = (totalram_pages > (1U << 30) / PAGE_SIZE) ? 8192 : max_t(unsigned long, 16, roundup_pow_of_two((totalram_pages << PAGE_SHIFT) / (1U << 14) / sizeof(struct hlist_head)));
max_entries = table_size * 8;
table_v4 = kvzalloc(table_size * sizeof(struct hlist_head), GFP_KERNEL);