From: Steffen Klassert <steffen.klassert@secunet.com>
To: David Miller <davem@davemloft.net>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
Steffen Klassert <steffen.klassert@secunet.com>,
<netdev@vger.kernel.org>
Subject: [PATCH 2/4] xfrm: use "unsigned int" in __xfrm6_pref_hash()
Date: Tue, 11 Apr 2017 07:53:50 +0200 [thread overview]
Message-ID: <1491890032-28655-3-git-send-email-steffen.klassert@secunet.com> (raw)
In-Reply-To: <1491890032-28655-1-git-send-email-steffen.klassert@secunet.com>
From: Alexey Dobriyan <adobriyan@gmail.com>
x86_64 is zero-extending arch so "unsigned int" is preferred over "int"
for address calculations.
Space savings:
add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-58 (-58)
function old new delta
xfrm_hash_resize 2752 2743 -9
policy_hash_bysel 985 973 -12
policy_hash_direct 1036 999 -37
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
net/xfrm/xfrm_hash.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/xfrm/xfrm_hash.h b/net/xfrm/xfrm_hash.h
index 666c5ff..eaea9c4 100644
--- a/net/xfrm/xfrm_hash.h
+++ b/net/xfrm/xfrm_hash.h
@@ -54,8 +54,8 @@ static inline unsigned int __xfrm4_dpref_spref_hash(const xfrm_address_t *daddr,
static inline unsigned int __xfrm6_pref_hash(const xfrm_address_t *addr,
__u8 prefixlen)
{
- int pdw;
- int pbi;
+ unsigned int pdw;
+ unsigned int pbi;
u32 initval = 0;
pdw = prefixlen >> 5; /* num of whole u32 in prefix */
--
2.7.4
next prev parent reply other threads:[~2017-04-11 5:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-11 5:53 pull request (net-next): ipsec-next 2017-04-11 Steffen Klassert
2017-04-11 5:53 ` [PATCH 1/4] xfrm: remove unused struct xfrm_mgr::id Steffen Klassert
2017-04-11 5:53 ` Steffen Klassert [this message]
2017-04-11 5:53 ` [PATCH 3/4] xfrm: use "unsigned int" in addr_match() Steffen Klassert
2017-04-11 5:53 ` [PATCH 4/4] xfrm: branchless addr4_match() on 64-bit Steffen Klassert
2017-04-11 14:32 ` pull request (net-next): ipsec-next 2017-04-11 David Miller
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=1491890032-28655-3-git-send-email-steffen.klassert@secunet.com \
--to=steffen.klassert@secunet.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.