Netdev List
 help / color / mirror / Atom feed
From: rongqing.li@windriver.com
To: netdev@vger.kernel.org, tgraf@suug.ch, herbert@gondor.apana.org.au
Subject: [PATCH][net-next] rhashtable: ensure that ht->p.min_size is round up to the power of two
Date: Fri, 20 Mar 2015 16:13:57 +0800	[thread overview]
Message-ID: <1426839237-10345-1-git-send-email-rongqing.li@windriver.com> (raw)

From: Li RongQing <roy.qing.li@gmail.com>

ht->p.min_size will be reset to params->min_size, which has been set
to the params->min_size round up of the power of two, should be kept

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Cc: Thomas Graf <tgraf@suug.ch>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
---
 lib/rhashtable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/rhashtable.c b/lib/rhashtable.c
index e75c48d..fda169b 100644
--- a/lib/rhashtable.c
+++ b/lib/rhashtable.c
@@ -946,7 +946,7 @@ int rhashtable_init(struct rhashtable *ht, struct rhashtable_params *params)
 	if (params->max_size)
 		ht->p.max_size = rounddown_pow_of_two(params->max_size);
 
-	ht->p.min_size = max(params->min_size, HASH_MIN_SIZE);
+	ht->p.min_size = max(ht->p.min_size, HASH_MIN_SIZE);
 
 	if (params->locks_mul)
 		ht->p.locks_mul = roundup_pow_of_two(params->locks_mul);
-- 
2.1.0

             reply	other threads:[~2015-03-20  8:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-20  8:13 rongqing.li [this message]
2015-03-20  8:49 ` [PATCH][net-next] rhashtable: ensure that ht->p.min_size is round up to the power of two Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1426839237-10345-1-git-send-email-rongqing.li@windriver.com \
    --to=rongqing.li@windriver.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    --cc=tgraf@suug.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox