From abddb8492c55482048b10788e00ec20e5ee3948f Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 25 Oct 2017 17:56:08 +0200 Subject: global: style nits Signed-off-by: Jason A. Donenfeld --- src/ratelimiter.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/ratelimiter.c') diff --git a/src/ratelimiter.c b/src/ratelimiter.c index a9caf32..8a73dd1 100644 --- a/src/ratelimiter.c +++ b/src/ratelimiter.c @@ -100,7 +100,8 @@ bool ratelimiter_allow(struct sk_buff *skb, struct net *net) bool ret; /* Inspired by nft_limit.c, but this is actually a slightly different * algorithm. Namely, we incorporate the burst as part of the maximum - * tokens, rather than as part of the rate. */ + * tokens, rather than as part of the rate. + */ spin_lock(&entry->lock); now = ktime_get_ns(); tokens = min_t(u64, TOKEN_MAX, entry->tokens + now - entry->last_time_ns); @@ -149,7 +150,8 @@ int ratelimiter_init(void) /* xt_hashlimit.c uses a slightly different algorithm for ratelimiting, * 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. */ + * dependent on RAM. This calculation here comes from there. + */ 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; -- cgit v1.2.3