From c8396bdc040f4b16e6f6e3f8b81b9fb67a499d9c Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Thu, 20 Jan 2011 14:48:23 +0100 Subject: Use annotated types and fix sparse warnings Annotated types are introduced and sparse warnings fixed. Two warnings remained in ip_set_core.c but those are false ones. (Patrick McHardy's review) --- kernel/include/linux/netfilter/ipset/ip_set_getport.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'kernel/include/linux/netfilter/ipset/ip_set_getport.h') diff --git a/kernel/include/linux/netfilter/ipset/ip_set_getport.h b/kernel/include/linux/netfilter/ipset/ip_set_getport.h index 8be8ecf..a5d243c 100644 --- a/kernel/include/linux/netfilter/ipset/ip_set_getport.h +++ b/kernel/include/linux/netfilter/ipset/ip_set_getport.h @@ -12,7 +12,7 @@ /* We must handle non-linear skbs */ static inline bool get_port(const struct sk_buff *skb, int protocol, unsigned int protooff, - bool src, u16 *port, u8 *proto) + bool src, __be16 *port, u8 *proto) { switch (protocol) { case IPPROTO_TCP: { @@ -47,7 +47,7 @@ get_port(const struct sk_buff *skb, int protocol, unsigned int protooff, if (ic == NULL) return false; - *port = (ic->type << 8) & ic->code; + *port = (__force __be16)((ic->type << 8) & ic->code); break; } case IPPROTO_ICMPV6: { @@ -58,7 +58,7 @@ get_port(const struct sk_buff *skb, int protocol, unsigned int protooff, if (ic == NULL) return false; - *port = (ic->icmp6_type << 8) & ic->icmp6_code; + *port = (__force __be16)((ic->icmp6_type << 8) & ic->icmp6_code); break; } default: @@ -70,7 +70,7 @@ get_port(const struct sk_buff *skb, int protocol, unsigned int protooff, } static inline bool -get_ip4_port(const struct sk_buff *skb, bool src, u16 *port, u8 *proto) +get_ip4_port(const struct sk_buff *skb, bool src, __be16 *port, u8 *proto) { const struct iphdr *iph = ip_hdr(skb); unsigned int protooff = ip_hdrlen(skb); @@ -84,7 +84,7 @@ get_ip4_port(const struct sk_buff *skb, bool src, u16 *port, u8 *proto) } static inline bool -get_ip6_port(const struct sk_buff *skb, bool src, u16 *port, u8 *proto) +get_ip6_port(const struct sk_buff *skb, bool src, __be16 *port, u8 *proto) { unsigned int protooff = 0; int protocol; @@ -98,7 +98,7 @@ get_ip6_port(const struct sk_buff *skb, bool src, u16 *port, u8 *proto) } static inline bool -get_ip_port(const struct sk_buff *skb, u8 pf, bool src, u16 *port) +get_ip_port(const struct sk_buff *skb, u8 pf, bool src, __be16 *port) { bool ret; u8 proto; -- cgit v1.2.3