diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2011-01-20 14:48:23 +0100 |
---|---|---|
committer | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2011-01-20 14:48:23 +0100 |
commit | c8396bdc040f4b16e6f6e3f8b81b9fb67a499d9c (patch) | |
tree | 0704d9f117fb9fefed1b9ec5e680e765d80ff877 /kernel/ip_set_bitmap_port.c | |
parent | 13dcc23a375f61d8286072b20067fb31bcc3ad46 (diff) |
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)
Diffstat (limited to 'kernel/ip_set_bitmap_port.c')
-rw-r--r-- | kernel/ip_set_bitmap_port.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/kernel/ip_set_bitmap_port.c b/kernel/ip_set_bitmap_port.c index ae1b2b3..dfece55 100644 --- a/kernel/ip_set_bitmap_port.c +++ b/kernel/ip_set_bitmap_port.c @@ -70,12 +70,13 @@ bitmap_port_kadt(struct ip_set *set, const struct sk_buff *skb, enum ipset_adt adt, u8 pf, u8 dim, u8 flags) { struct bitmap_port *map = set->data; + __be16 __port; u16 port = 0; - if (!get_ip_port(skb, pf, flags & IPSET_DIM_ONE_SRC, &port)) + if (!get_ip_port(skb, pf, flags & IPSET_DIM_ONE_SRC, &__port)) return -EINVAL; - port = ntohs(port); + port = ntohs(__port); if (port < map->first_port || port > map->last_port) return -IPSET_ERR_BITMAP_RANGE; @@ -249,7 +250,7 @@ bitmap_port_same_set(const struct ip_set *a, const struct ip_set *b) x->last_port == y->last_port; } -const struct ip_set_type_variant bitmap_port = { +static const struct ip_set_type_variant bitmap_port = { .kadt = bitmap_port_kadt, .uadt = bitmap_port_uadt, .destroy = bitmap_port_destroy, @@ -307,12 +308,13 @@ bitmap_port_timeout_kadt(struct ip_set *set, const struct sk_buff *skb, enum ipset_adt adt, u8 pf, u8 dim, u8 flags) { struct bitmap_port_timeout *map = set->data; + __be16 __port; u16 port = 0; - if (!get_ip_port(skb, pf, flags & IPSET_DIM_ONE_SRC, &port)) + if (!get_ip_port(skb, pf, flags & IPSET_DIM_ONE_SRC, &__port)) return -EINVAL; - port = ntohs(port); + port = ntohs(__port); if (port < map->first_port || port > map->last_port) return -IPSET_ERR_BITMAP_RANGE; @@ -487,7 +489,7 @@ bitmap_port_timeout_same_set(const struct ip_set *a, const struct ip_set *b) x->timeout == y->timeout; } -const struct ip_set_type_variant bitmap_port_timeout = { +static const struct ip_set_type_variant bitmap_port_timeout = { .kadt = bitmap_port_timeout_kadt, .uadt = bitmap_port_timeout_uadt, .destroy = bitmap_port_timeout_destroy, @@ -621,7 +623,7 @@ bitmap_port_create(struct ip_set *set, struct nlattr *head, int len, return 0; } -struct ip_set_type bitmap_port_type = { +static struct ip_set_type bitmap_port_type = { .name = "bitmap:port", .protocol = IPSET_PROTOCOL, .features = IPSET_TYPE_PORT, |