Skip to content

Commit 15b4d93

Browse files
Jozsef Kadlecsikkaber
authored andcommitted
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>
1 parent e385357 commit 15b4d93

11 files changed

Lines changed: 28 additions & 27 deletions

File tree

‎include/linux/netfilter/ipset/ip_set.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ struct ip_set {
331331
/* register and unregister set references */
332332
extern ip_set_id_t ip_set_get_byname(const char *name, struct ip_set **set);
333333
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);
335335
extern ip_set_id_t ip_set_nfnl_get(const char *name);
336336
extern ip_set_id_t ip_set_nfnl_get_byindex(ip_set_id_t index);
337337
extern void ip_set_nfnl_put(ip_set_id_t index);
@@ -349,7 +349,7 @@ extern int ip_set_test(ip_set_id_t id, const struct sk_buff *skb,
349349
const struct ip_set_adt_opt *opt);
350350

351351
/* Utility functions */
352-
extern void * ip_set_alloc(size_t size);
352+
extern void *ip_set_alloc(size_t size);
353353
extern void ip_set_free(void *members);
354354
extern int ip_set_get_ipaddr4(struct nlattr *nla, __be32 *ipaddr);
355355
extern int ip_set_get_ipaddr6(struct nlattr *nla, union nf_inet_addr *ipaddr);
@@ -359,7 +359,7 @@ ip_set_get_hostipaddr4(struct nlattr *nla, u32 *ipaddr)
359359
{
360360
__be32 ip;
361361
int ret = ip_set_get_ipaddr4(nla, &ip);
362-
362+
363363
if (ret)
364364
return ret;
365365
*ipaddr = ntohl(ip);

‎include/linux/netfilter/ipset/ip_set_ahash.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ struct htable {
4343
struct hbucket bucket[0]; /* hashtable buckets */
4444
};
4545

46-
#define hbucket(h, i) &((h)->bucket[i])
46+
#define hbucket(h, i) (&((h)->bucket[i]))
4747

4848
/* Book-keeping of the prefixes added to the set */
4949
struct ip_set_hash_nets {

‎include/linux/netfilter/ipset/ip_set_timeout.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ ip_set_timeout_set(u32 timeout)
7878
static inline u32
7979
ip_set_timeout_get(unsigned long timeout)
8080
{
81-
return timeout == IPSET_ELEM_PERMANENT ? 0 :
81+
return timeout == IPSET_ELEM_PERMANENT ? 0 :
8282
jiffies_to_msecs(timeout - jiffies)/1000;
8383
}
8484

‎include/linux/netfilter/ipset/pfxlen.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define _PFXLEN_H
33

44
#include <asm/byteorder.h>
5-
#include <linux/netfilter.h>
5+
#include <linux/netfilter.h>
66
#include <net/tcp.h>
77

88
/* Prefixlen maps, by Jan Engelhardt */

‎net/netfilter/ipset/ip_set_bitmap_ipmac.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,8 @@ static struct ip_set_type bitmap_ipmac_type = {
635635
},
636636
.adt_policy = {
637637
[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 },
639640
[IPSET_ATTR_TIMEOUT] = { .type = NLA_U32 },
640641
[IPSET_ATTR_LINENO] = { .type = NLA_U32 },
641642
},

‎net/netfilter/ipset/ip_set_core.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,8 +683,8 @@ ip_set_create(struct sock *ctnl, struct sk_buff *skb,
683683
if (attr[IPSET_ATTR_DATA] &&
684684
nla_parse_nested(tb, IPSET_ATTR_CREATE_MAX, attr[IPSET_ATTR_DATA],
685685
set->type->create_policy)) {
686-
ret = -IPSET_ERR_PROTOCOL;
687-
goto put_out;
686+
ret = -IPSET_ERR_PROTOCOL;
687+
goto put_out;
688688
}
689689

690690
ret = set->type->create(set, tb, flags);

‎net/netfilter/ipset/ip_set_hash_net.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ hash_net4_uadt(struct ip_set *set, struct nlattr *tb[],
187187
return -IPSET_ERR_TIMEOUT;
188188
timeout = ip_set_timeout_uget(tb[IPSET_ATTR_TIMEOUT]);
189189
}
190-
190+
191191
if (adt == IPSET_TEST || !tb[IPSET_ATTR_IP_TO]) {
192192
data.ip = htonl(ip & ip_set_hostmask(data.cidr));
193193
ret = adtfn(set, &data, timeout, flags);
@@ -205,7 +205,7 @@ hash_net4_uadt(struct ip_set *set, struct nlattr *tb[],
205205
return -IPSET_ERR_HASH_RANGE;
206206
}
207207
if (retried)
208-
ip = h->next.ip;
208+
ip = h->next.ip;
209209
while (!after(ip, ip_to)) {
210210
data.ip = htonl(ip);
211211
last = ip_set_range_to_cidr(ip, ip_to, &data.cidr);

‎net/netfilter/ipset/ip_set_hash_netiface.c‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ iface_test(struct rb_root *root, const char **iface)
100100
while (n) {
101101
const char *d = iface_data(n);
102102
int res = ifname_compare(*iface, d);
103-
103+
104104
if (res < 0)
105105
n = n->rb_left;
106106
else if (res > 0)
@@ -118,7 +118,7 @@ iface_add(struct rb_root *root, const char **iface)
118118
{
119119
struct rb_node **n = &(root->rb_node), *p = NULL;
120120
struct iface_node *d;
121-
121+
122122
while (*n) {
123123
char *ifname = iface_data(*n);
124124
int res = ifname_compare(*iface, ifname);
@@ -296,10 +296,10 @@ hash_netiface4_kadt(struct ip_set *set, const struct sk_buff *skb,
296296
if (opt->cmdflags & IPSET_FLAG_PHYSDEV) {
297297
#ifdef CONFIG_BRIDGE_NETFILTER
298298
const struct nf_bridge_info *nf_bridge = skb->nf_bridge;
299-
299+
300300
if (!nf_bridge)
301301
return -EINVAL;
302-
data.iface = SRCDIR ? PHYSDEV(physindev): PHYSDEV(physoutdev);
302+
data.iface = SRCDIR ? PHYSDEV(physindev) : PHYSDEV(physoutdev);
303303
data.physdev = 1;
304304
#else
305305
data.iface = NULL;
@@ -350,7 +350,7 @@ hash_netiface4_uadt(struct ip_set *set, struct nlattr *tb[],
350350
if (tb[IPSET_ATTR_CIDR]) {
351351
data.cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]);
352352
if (!data.cidr)
353-
return -IPSET_ERR_INVALID_CIDR;
353+
return -IPSET_ERR_INVALID_CIDR;
354354
}
355355

356356
if (tb[IPSET_ATTR_TIMEOUT]) {
@@ -359,7 +359,7 @@ hash_netiface4_uadt(struct ip_set *set, struct nlattr *tb[],
359359
timeout = ip_set_timeout_uget(tb[IPSET_ATTR_TIMEOUT]);
360360
}
361361

362-
strcpy(iface, nla_data(tb[IPSET_ATTR_IFACE]));
362+
strcpy(iface, nla_data(tb[IPSET_ATTR_IFACE]));
363363
data.iface = iface;
364364
ret = iface_test(&h->rbtree, &data.iface);
365365
if (adt == IPSET_ADD) {
@@ -372,8 +372,8 @@ hash_netiface4_uadt(struct ip_set *set, struct nlattr *tb[],
372372
return ret;
373373

374374
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)
377377
data.physdev = 1;
378378
}
379379

@@ -559,10 +559,10 @@ hash_netiface6_kadt(struct ip_set *set, const struct sk_buff *skb,
559559
if (opt->cmdflags & IPSET_FLAG_PHYSDEV) {
560560
#ifdef CONFIG_BRIDGE_NETFILTER
561561
const struct nf_bridge_info *nf_bridge = skb->nf_bridge;
562-
562+
563563
if (!nf_bridge)
564564
return -EINVAL;
565-
data.iface = SRCDIR ? PHYSDEV(physindev): PHYSDEV(physoutdev);
565+
data.iface = SRCDIR ? PHYSDEV(physindev) : PHYSDEV(physoutdev);
566566
data.physdev = 1;
567567
#else
568568
data.iface = NULL;
@@ -623,7 +623,7 @@ hash_netiface6_uadt(struct ip_set *set, struct nlattr *tb[],
623623
timeout = ip_set_timeout_uget(tb[IPSET_ATTR_TIMEOUT]);
624624
}
625625

626-
strcpy(iface, nla_data(tb[IPSET_ATTR_IFACE]));
626+
strcpy(iface, nla_data(tb[IPSET_ATTR_IFACE]));
627627
data.iface = iface;
628628
ret = iface_test(&h->rbtree, &data.iface);
629629
if (adt == IPSET_ADD) {
@@ -636,8 +636,8 @@ hash_netiface6_uadt(struct ip_set *set, struct nlattr *tb[],
636636
return ret;
637637

638638
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)
641641
data.physdev = 1;
642642
}
643643

‎net/netfilter/ipset/ip_set_hash_netport.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ hash_netport4_uadt(struct ip_set *set, struct nlattr *tb[],
199199
if (tb[IPSET_ATTR_CIDR]) {
200200
data.cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]);
201201
if (!data.cidr)
202-
return -IPSET_ERR_INVALID_CIDR;
202+
return -IPSET_ERR_INVALID_CIDR;
203203
}
204204

205205
if (tb[IPSET_ATTR_PORT])

‎net/netfilter/ipset/pfxlen.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ const union nf_inet_addr ip_set_netmask_map[] = {
148148
EXPORT_SYMBOL_GPL(ip_set_netmask_map);
149149

150150
#undef E
151-
#define E(a, b, c, d) \
151+
#define E(a, b, c, d) \
152152
{.ip6 = { (__force __be32) a, (__force __be32) b, \
153153
(__force __be32) c, (__force __be32) d, \
154154
} }

0 commit comments

Comments
 (0)