Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: ipset: whitespace and coding fixes detected by checkpatch.pl

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Patrick McHardy <kaber@trash.net>

authored by

Jozsef Kadlecsik and committed by
Patrick McHardy
15b4d93f e385357a

+28 -27
+3 -3
include/linux/netfilter/ipset/ip_set.h
··· 331 331 /* register and unregister set references */ 332 332 extern ip_set_id_t ip_set_get_byname(const char *name, struct ip_set **set); 333 333 extern void ip_set_put_byindex(ip_set_id_t index); 334 - extern const char * ip_set_name_byindex(ip_set_id_t index); 334 + extern const char *ip_set_name_byindex(ip_set_id_t index); 335 335 extern ip_set_id_t ip_set_nfnl_get(const char *name); 336 336 extern ip_set_id_t ip_set_nfnl_get_byindex(ip_set_id_t index); 337 337 extern void ip_set_nfnl_put(ip_set_id_t index); ··· 349 349 const struct ip_set_adt_opt *opt); 350 350 351 351 /* Utility functions */ 352 - extern void * ip_set_alloc(size_t size); 352 + extern void *ip_set_alloc(size_t size); 353 353 extern void ip_set_free(void *members); 354 354 extern int ip_set_get_ipaddr4(struct nlattr *nla, __be32 *ipaddr); 355 355 extern int ip_set_get_ipaddr6(struct nlattr *nla, union nf_inet_addr *ipaddr); ··· 359 359 { 360 360 __be32 ip; 361 361 int ret = ip_set_get_ipaddr4(nla, &ip); 362 - 362 + 363 363 if (ret) 364 364 return ret; 365 365 *ipaddr = ntohl(ip);
+1 -1
include/linux/netfilter/ipset/ip_set_ahash.h
··· 43 43 struct hbucket bucket[0]; /* hashtable buckets */ 44 44 }; 45 45 46 - #define hbucket(h, i) &((h)->bucket[i]) 46 + #define hbucket(h, i) (&((h)->bucket[i])) 47 47 48 48 /* Book-keeping of the prefixes added to the set */ 49 49 struct ip_set_hash_nets {
+1 -1
include/linux/netfilter/ipset/ip_set_timeout.h
··· 78 78 static inline u32 79 79 ip_set_timeout_get(unsigned long timeout) 80 80 { 81 - return timeout == IPSET_ELEM_PERMANENT ? 0 : 81 + return timeout == IPSET_ELEM_PERMANENT ? 0 : 82 82 jiffies_to_msecs(timeout - jiffies)/1000; 83 83 } 84 84
+1 -1
include/linux/netfilter/ipset/pfxlen.h
··· 2 2 #define _PFXLEN_H 3 3 4 4 #include <asm/byteorder.h> 5 - #include <linux/netfilter.h> 5 + #include <linux/netfilter.h> 6 6 #include <net/tcp.h> 7 7 8 8 /* Prefixlen maps, by Jan Engelhardt */
+2 -1
net/netfilter/ipset/ip_set_bitmap_ipmac.c
··· 635 635 }, 636 636 .adt_policy = { 637 637 [IPSET_ATTR_IP] = { .type = NLA_NESTED }, 638 - [IPSET_ATTR_ETHER] = { .type = NLA_BINARY, .len = ETH_ALEN }, 638 + [IPSET_ATTR_ETHER] = { .type = NLA_BINARY, 639 + .len = ETH_ALEN }, 639 640 [IPSET_ATTR_TIMEOUT] = { .type = NLA_U32 }, 640 641 [IPSET_ATTR_LINENO] = { .type = NLA_U32 }, 641 642 },
+2 -2
net/netfilter/ipset/ip_set_core.c
··· 683 683 if (attr[IPSET_ATTR_DATA] && 684 684 nla_parse_nested(tb, IPSET_ATTR_CREATE_MAX, attr[IPSET_ATTR_DATA], 685 685 set->type->create_policy)) { 686 - ret = -IPSET_ERR_PROTOCOL; 687 - goto put_out; 686 + ret = -IPSET_ERR_PROTOCOL; 687 + goto put_out; 688 688 } 689 689 690 690 ret = set->type->create(set, tb, flags);
+2 -2
net/netfilter/ipset/ip_set_hash_net.c
··· 187 187 return -IPSET_ERR_TIMEOUT; 188 188 timeout = ip_set_timeout_uget(tb[IPSET_ATTR_TIMEOUT]); 189 189 } 190 - 190 + 191 191 if (adt == IPSET_TEST || !tb[IPSET_ATTR_IP_TO]) { 192 192 data.ip = htonl(ip & ip_set_hostmask(data.cidr)); 193 193 ret = adtfn(set, &data, timeout, flags); ··· 205 205 return -IPSET_ERR_HASH_RANGE; 206 206 } 207 207 if (retried) 208 - ip = h->next.ip; 208 + ip = h->next.ip; 209 209 while (!after(ip, ip_to)) { 210 210 data.ip = htonl(ip); 211 211 last = ip_set_range_to_cidr(ip, ip_to, &data.cidr);
+13 -13
net/netfilter/ipset/ip_set_hash_netiface.c
··· 100 100 while (n) { 101 101 const char *d = iface_data(n); 102 102 int res = ifname_compare(*iface, d); 103 - 103 + 104 104 if (res < 0) 105 105 n = n->rb_left; 106 106 else if (res > 0) ··· 118 118 { 119 119 struct rb_node **n = &(root->rb_node), *p = NULL; 120 120 struct iface_node *d; 121 - 121 + 122 122 while (*n) { 123 123 char *ifname = iface_data(*n); 124 124 int res = ifname_compare(*iface, ifname); ··· 296 296 if (opt->cmdflags & IPSET_FLAG_PHYSDEV) { 297 297 #ifdef CONFIG_BRIDGE_NETFILTER 298 298 const struct nf_bridge_info *nf_bridge = skb->nf_bridge; 299 - 299 + 300 300 if (!nf_bridge) 301 301 return -EINVAL; 302 - data.iface = SRCDIR ? PHYSDEV(physindev): PHYSDEV(physoutdev); 302 + data.iface = SRCDIR ? PHYSDEV(physindev) : PHYSDEV(physoutdev); 303 303 data.physdev = 1; 304 304 #else 305 305 data.iface = NULL; ··· 350 350 if (tb[IPSET_ATTR_CIDR]) { 351 351 data.cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); 352 352 if (!data.cidr) 353 - return -IPSET_ERR_INVALID_CIDR; 353 + return -IPSET_ERR_INVALID_CIDR; 354 354 } 355 355 356 356 if (tb[IPSET_ATTR_TIMEOUT]) { ··· 359 359 timeout = ip_set_timeout_uget(tb[IPSET_ATTR_TIMEOUT]); 360 360 } 361 361 362 - strcpy(iface, nla_data(tb[IPSET_ATTR_IFACE])); 362 + strcpy(iface, nla_data(tb[IPSET_ATTR_IFACE])); 363 363 data.iface = iface; 364 364 ret = iface_test(&h->rbtree, &data.iface); 365 365 if (adt == IPSET_ADD) { ··· 372 372 return ret; 373 373 374 374 if (tb[IPSET_ATTR_CADT_FLAGS]) { 375 - u32 flags = ip_set_get_h32(tb[IPSET_ATTR_CADT_FLAGS]); 376 - if (flags & IPSET_FLAG_PHYSDEV) 375 + u32 cadt_flags = ip_set_get_h32(tb[IPSET_ATTR_CADT_FLAGS]); 376 + if (cadt_flags & IPSET_FLAG_PHYSDEV) 377 377 data.physdev = 1; 378 378 } 379 379 ··· 559 559 if (opt->cmdflags & IPSET_FLAG_PHYSDEV) { 560 560 #ifdef CONFIG_BRIDGE_NETFILTER 561 561 const struct nf_bridge_info *nf_bridge = skb->nf_bridge; 562 - 562 + 563 563 if (!nf_bridge) 564 564 return -EINVAL; 565 - data.iface = SRCDIR ? PHYSDEV(physindev): PHYSDEV(physoutdev); 565 + data.iface = SRCDIR ? PHYSDEV(physindev) : PHYSDEV(physoutdev); 566 566 data.physdev = 1; 567 567 #else 568 568 data.iface = NULL; ··· 623 623 timeout = ip_set_timeout_uget(tb[IPSET_ATTR_TIMEOUT]); 624 624 } 625 625 626 - strcpy(iface, nla_data(tb[IPSET_ATTR_IFACE])); 626 + strcpy(iface, nla_data(tb[IPSET_ATTR_IFACE])); 627 627 data.iface = iface; 628 628 ret = iface_test(&h->rbtree, &data.iface); 629 629 if (adt == IPSET_ADD) { ··· 636 636 return ret; 637 637 638 638 if (tb[IPSET_ATTR_CADT_FLAGS]) { 639 - u32 flags = ip_set_get_h32(tb[IPSET_ATTR_CADT_FLAGS]); 640 - if (flags & IPSET_FLAG_PHYSDEV) 639 + u32 cadt_flags = ip_set_get_h32(tb[IPSET_ATTR_CADT_FLAGS]); 640 + if (cadt_flags & IPSET_FLAG_PHYSDEV) 641 641 data.physdev = 1; 642 642 } 643 643
+1 -1
net/netfilter/ipset/ip_set_hash_netport.c
··· 199 199 if (tb[IPSET_ATTR_CIDR]) { 200 200 data.cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]); 201 201 if (!data.cidr) 202 - return -IPSET_ERR_INVALID_CIDR; 202 + return -IPSET_ERR_INVALID_CIDR; 203 203 } 204 204 205 205 if (tb[IPSET_ATTR_PORT])
+1 -1
net/netfilter/ipset/pfxlen.c
··· 148 148 EXPORT_SYMBOL_GPL(ip_set_netmask_map); 149 149 150 150 #undef E 151 - #define E(a, b, c, d) \ 151 + #define E(a, b, c, d) \ 152 152 {.ip6 = { (__force __be32) a, (__force __be32) b, \ 153 153 (__force __be32) c, (__force __be32) d, \ 154 154 } }
+1 -1
net/netfilter/xt_set.c
··· 37 37 return inv; 38 38 } 39 39 40 - #define ADT_OPT(n, f, d, fs, cfs, t) \ 40 + #define ADT_OPT(n, f, d, fs, cfs, t) \ 41 41 const struct ip_set_adt_opt n = { \ 42 42 .family = f, \ 43 43 .dim = d, \