Commit 75e7ce66 authored by Al Viro's avatar Al Viro Committed by David S. Miller

[IPVS]: Annotate ..._app_hashkey().

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a64b78a0
...@@ -490,16 +490,18 @@ tcp_state_transition(struct ip_vs_conn *cp, int direction, ...@@ -490,16 +490,18 @@ tcp_state_transition(struct ip_vs_conn *cp, int direction,
static struct list_head tcp_apps[TCP_APP_TAB_SIZE]; static struct list_head tcp_apps[TCP_APP_TAB_SIZE];
static DEFINE_SPINLOCK(tcp_app_lock); static DEFINE_SPINLOCK(tcp_app_lock);
static inline __u16 tcp_app_hashkey(__u16 port) static inline __u16 tcp_app_hashkey(__be16 port)
{ {
return ((port >> TCP_APP_TAB_BITS) ^ port) & TCP_APP_TAB_MASK; return (((__force u16)port >> TCP_APP_TAB_BITS) ^ (__force u16)port)
& TCP_APP_TAB_MASK;
} }
static int tcp_register_app(struct ip_vs_app *inc) static int tcp_register_app(struct ip_vs_app *inc)
{ {
struct ip_vs_app *i; struct ip_vs_app *i;
__u16 hash, port = inc->port; __u16 hash;
__be16 port = inc->port;
int ret = 0; int ret = 0;
hash = tcp_app_hashkey(port); hash = tcp_app_hashkey(port);
......
...@@ -282,16 +282,18 @@ udp_csum_check(struct sk_buff *skb, struct ip_vs_protocol *pp) ...@@ -282,16 +282,18 @@ udp_csum_check(struct sk_buff *skb, struct ip_vs_protocol *pp)
static struct list_head udp_apps[UDP_APP_TAB_SIZE]; static struct list_head udp_apps[UDP_APP_TAB_SIZE];
static DEFINE_SPINLOCK(udp_app_lock); static DEFINE_SPINLOCK(udp_app_lock);
static inline __u16 udp_app_hashkey(__u16 port) static inline __u16 udp_app_hashkey(__be16 port)
{ {
return ((port >> UDP_APP_TAB_BITS) ^ port) & UDP_APP_TAB_MASK; return (((__force u16)port >> UDP_APP_TAB_BITS) ^ (__force u16)port)
& UDP_APP_TAB_MASK;
} }
static int udp_register_app(struct ip_vs_app *inc) static int udp_register_app(struct ip_vs_app *inc)
{ {
struct ip_vs_app *i; struct ip_vs_app *i;
__u16 hash, port = inc->port; __u16 hash;
__be16 port = inc->port;
int ret = 0; int ret = 0;
hash = udp_app_hashkey(port); hash = udp_app_hashkey(port);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment