mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-25 08:02:56 +00:00
netns: constify net_hash_mix() and various callers
const qualifiers ease code review by making clear which objects are not written in a function. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8f6320de5f
commit
6eada0110c
9 changed files with 31 additions and 31 deletions
|
@ -221,8 +221,8 @@ inet_bind_bucket_create(struct kmem_cache *cachep, struct net *net,
|
|||
void inet_bind_bucket_destroy(struct kmem_cache *cachep,
|
||||
struct inet_bind_bucket *tb);
|
||||
|
||||
static inline int inet_bhashfn(struct net *net, const __u16 lport,
|
||||
const int bhash_size)
|
||||
static inline u32 inet_bhashfn(const struct net *net, const __u16 lport,
|
||||
const u32 bhash_size)
|
||||
{
|
||||
return (lport + net_hash_mix(net)) & (bhash_size - 1);
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb,
|
|||
const unsigned short snum);
|
||||
|
||||
/* These can have wildcards, don't try too hard. */
|
||||
static inline int inet_lhashfn(struct net *net, const unsigned short num)
|
||||
static inline u32 inet_lhashfn(const struct net *net, const unsigned short num)
|
||||
{
|
||||
return (num + net_hash_mix(net)) & (INET_LHTABLE_SIZE - 1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue