diff options
author | Joe Perches <joe@perches.com> | 2014-05-13 23:30:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-14 16:07:23 -0400 |
commit | c7228317441f4dee5e5916e30300dd8c61f75af7 (patch) | |
tree | d1a2183e764d0c424bd44f41ea4e1db9937be84c | |
parent | 126e612223c885a8718839d97c67473503bea58a (diff) |
net: Use a more standard macro for INET_ADDR_COOKIE
Missing a colon on definition use is a bit odd so
change the macro for the 32 bit case to declare an
__attribute__((unused)) and __deprecated variable.
The __deprecated attribute will cause gcc to emit
an error if the variable is actually used.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/inet_hashtables.h | 8 | ||||
-rw-r--r-- | net/ipv4/inet_hashtables.c | 4 | ||||
-rw-r--r-- | net/ipv4/udp.c | 2 |
3 files changed, 8 insertions, 6 deletions
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index 1bdb47715def..dd1950a7e273 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
@@ -292,12 +292,12 @@ static inline struct sock *inet_lookup_listener(struct net *net, | |||
292 | #define INET_ADDR_COOKIE(__name, __saddr, __daddr) \ | 292 | #define INET_ADDR_COOKIE(__name, __saddr, __daddr) \ |
293 | const __addrpair __name = (__force __addrpair) ( \ | 293 | const __addrpair __name = (__force __addrpair) ( \ |
294 | (((__force __u64)(__be32)(__saddr)) << 32) | \ | 294 | (((__force __u64)(__be32)(__saddr)) << 32) | \ |
295 | ((__force __u64)(__be32)(__daddr))); | 295 | ((__force __u64)(__be32)(__daddr))) |
296 | #else /* __LITTLE_ENDIAN */ | 296 | #else /* __LITTLE_ENDIAN */ |
297 | #define INET_ADDR_COOKIE(__name, __saddr, __daddr) \ | 297 | #define INET_ADDR_COOKIE(__name, __saddr, __daddr) \ |
298 | const __addrpair __name = (__force __addrpair) ( \ | 298 | const __addrpair __name = (__force __addrpair) ( \ |
299 | (((__force __u64)(__be32)(__daddr)) << 32) | \ | 299 | (((__force __u64)(__be32)(__daddr)) << 32) | \ |
300 | ((__force __u64)(__be32)(__saddr))); | 300 | ((__force __u64)(__be32)(__saddr))) |
301 | #endif /* __BIG_ENDIAN */ | 301 | #endif /* __BIG_ENDIAN */ |
302 | #define INET_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif) \ | 302 | #define INET_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif) \ |
303 | (((__sk)->sk_portpair == (__ports)) && \ | 303 | (((__sk)->sk_portpair == (__ports)) && \ |
@@ -306,7 +306,9 @@ static inline struct sock *inet_lookup_listener(struct net *net, | |||
306 | ((__sk)->sk_bound_dev_if == (__dif))) && \ | 306 | ((__sk)->sk_bound_dev_if == (__dif))) && \ |
307 | net_eq(sock_net(__sk), (__net))) | 307 | net_eq(sock_net(__sk), (__net))) |
308 | #else /* 32-bit arch */ | 308 | #else /* 32-bit arch */ |
309 | #define INET_ADDR_COOKIE(__name, __saddr, __daddr) | 309 | #define INET_ADDR_COOKIE(__name, __saddr, __daddr) \ |
310 | const int __name __deprecated __attribute__((unused)) | ||
311 | |||
310 | #define INET_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif) \ | 312 | #define INET_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif) \ |
311 | (((__sk)->sk_portpair == (__ports)) && \ | 313 | (((__sk)->sk_portpair == (__ports)) && \ |
312 | ((__sk)->sk_daddr == (__saddr)) && \ | 314 | ((__sk)->sk_daddr == (__saddr)) && \ |
diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c index 83331f1b86ac..43116e8c8e13 100644 --- a/net/ipv4/inet_hashtables.c +++ b/net/ipv4/inet_hashtables.c | |||
@@ -274,7 +274,7 @@ struct sock *__inet_lookup_established(struct net *net, | |||
274 | const __be32 daddr, const u16 hnum, | 274 | const __be32 daddr, const u16 hnum, |
275 | const int dif) | 275 | const int dif) |
276 | { | 276 | { |
277 | INET_ADDR_COOKIE(acookie, saddr, daddr) | 277 | INET_ADDR_COOKIE(acookie, saddr, daddr); |
278 | const __portpair ports = INET_COMBINED_PORTS(sport, hnum); | 278 | const __portpair ports = INET_COMBINED_PORTS(sport, hnum); |
279 | struct sock *sk; | 279 | struct sock *sk; |
280 | const struct hlist_nulls_node *node; | 280 | const struct hlist_nulls_node *node; |
@@ -327,7 +327,7 @@ static int __inet_check_established(struct inet_timewait_death_row *death_row, | |||
327 | __be32 daddr = inet->inet_rcv_saddr; | 327 | __be32 daddr = inet->inet_rcv_saddr; |
328 | __be32 saddr = inet->inet_daddr; | 328 | __be32 saddr = inet->inet_daddr; |
329 | int dif = sk->sk_bound_dev_if; | 329 | int dif = sk->sk_bound_dev_if; |
330 | INET_ADDR_COOKIE(acookie, saddr, daddr) | 330 | INET_ADDR_COOKIE(acookie, saddr, daddr); |
331 | const __portpair ports = INET_COMBINED_PORTS(inet->inet_dport, lport); | 331 | const __portpair ports = INET_COMBINED_PORTS(inet->inet_dport, lport); |
332 | struct net *net = sock_net(sk); | 332 | struct net *net = sock_net(sk); |
333 | unsigned int hash = inet_ehashfn(net, daddr, lport, | 333 | unsigned int hash = inet_ehashfn(net, daddr, lport, |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 6729ea97a59d..590532a7bd2d 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -1875,7 +1875,7 @@ static struct sock *__udp4_lib_demux_lookup(struct net *net, | |||
1875 | unsigned int hash2 = udp4_portaddr_hash(net, loc_addr, hnum); | 1875 | unsigned int hash2 = udp4_portaddr_hash(net, loc_addr, hnum); |
1876 | unsigned int slot2 = hash2 & udp_table.mask; | 1876 | unsigned int slot2 = hash2 & udp_table.mask; |
1877 | struct udp_hslot *hslot2 = &udp_table.hash2[slot2]; | 1877 | struct udp_hslot *hslot2 = &udp_table.hash2[slot2]; |
1878 | INET_ADDR_COOKIE(acookie, rmt_addr, loc_addr) | 1878 | INET_ADDR_COOKIE(acookie, rmt_addr, loc_addr); |
1879 | const __portpair ports = INET_COMBINED_PORTS(rmt_port, hnum); | 1879 | const __portpair ports = INET_COMBINED_PORTS(rmt_port, hnum); |
1880 | 1880 | ||
1881 | rcu_read_lock(); | 1881 | rcu_read_lock(); |