diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2017-03-23 18:53:09 -0400 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2017-03-24 02:03:12 -0400 |
commit | d7f6946630bc324b9d791bee6dc41ff0d9469b0b (patch) | |
tree | 49110d8f3f630d362098f8fd157d9d92594e6e54 | |
parent | 1560875600b8aa88ff0f55f827a7741c026795ee (diff) |
xfrm: use "unsigned int" in __xfrm6_pref_hash()
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>
-rw-r--r-- | net/xfrm/xfrm_hash.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/xfrm/xfrm_hash.h b/net/xfrm/xfrm_hash.h index 666c5ffe929d..eaea9c4fb3b0 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, | |||
54 | static inline unsigned int __xfrm6_pref_hash(const xfrm_address_t *addr, | 54 | static inline unsigned int __xfrm6_pref_hash(const xfrm_address_t *addr, |
55 | __u8 prefixlen) | 55 | __u8 prefixlen) |
56 | { | 56 | { |
57 | int pdw; | 57 | unsigned int pdw; |
58 | int pbi; | 58 | unsigned int pbi; |
59 | u32 initval = 0; | 59 | u32 initval = 0; |
60 | 60 | ||
61 | pdw = prefixlen >> 5; /* num of whole u32 in prefix */ | 61 | pdw = prefixlen >> 5; /* num of whole u32 in prefix */ |