ip_frag: struct inet_frags match() method returns a bool
authorEric Dumazet <edumazet@google.com>
Fri, 18 May 2012 03:57:13 +0000 (05:57 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 May 2012 05:40:27 +0000 (01:40 -0400)
- match() method returns a boolean
- return (A && B && C && D) -> return A && B && C && D
- fix indentation

Signed-off-by: Eric Dumazet <edumazet@google.com>
include/net/inet_frag.h
include/net/ipv6.h
net/ipv4/ip_fragment.c
net/ipv6/reassembly.c

index 16ff29a7bb30cfbf5e1581c1388e321e9d9f2a1b..2431cf83aecafb74ca1e9464bec6f6a669046d75 100644 (file)
@@ -46,8 +46,7 @@ struct inet_frags {
                                                void *arg);
        void                    (*destructor)(struct inet_frag_queue *);
        void                    (*skb_free)(struct sk_buff *);
-       int                     (*match)(struct inet_frag_queue *q,
-                                               void *arg);
+       bool                    (*match)(struct inet_frag_queue *q, void *arg);
        void                    (*frag_expire)(unsigned long data);
 };
 
index 4332e9aad853a77a047634dbbf38421db1cd6c84..5f65e7c452666f9c5458f5fd5e45fc880db12d0f 100644 (file)
@@ -387,7 +387,7 @@ struct ip6_create_arg {
 };
 
 void ip6_frag_init(struct inet_frag_queue *q, void *a);
-int ip6_frag_match(struct inet_frag_queue *q, void *a);
+bool ip6_frag_match(struct inet_frag_queue *q, void *a);
 
 static inline int ipv6_addr_any(const struct in6_addr *a)
 {
index 9f9bd139335f42fb881f613da04fbe1c5a1049c8..695b27f44161b5656bb54863f9a983fb23ae5206 100644 (file)
@@ -148,17 +148,17 @@ static unsigned int ip4_hashfn(struct inet_frag_queue *q)
        return ipqhashfn(ipq->id, ipq->saddr, ipq->daddr, ipq->protocol);
 }
 
-static int ip4_frag_match(struct inet_frag_queue *q, void *a)
+static bool ip4_frag_match(struct inet_frag_queue *q, void *a)
 {
        struct ipq *qp;
        struct ip4_create_arg *arg = a;
 
        qp = container_of(q, struct ipq, q);
        return  qp->id == arg->iph->id &&
-                       qp->saddr == arg->iph->saddr &&
-                       qp->daddr == arg->iph->daddr &&
-                       qp->protocol == arg->iph->protocol &&
-                       qp->user == arg->user;
+               qp->saddr == arg->iph->saddr &&
+               qp->daddr == arg->iph->daddr &&
+               qp->protocol == arg->iph->protocol &&
+               qp->user == arg->user;
 }
 
 /* Memory Tracking Functions. */
index f1b86fdc06ad36ac6d6edc1095a6ae7ec3212213..5d32dfa4d75aaee6d2748cd526fe9af0fb247572 100644 (file)
@@ -134,15 +134,16 @@ static unsigned int ip6_hashfn(struct inet_frag_queue *q)
        return inet6_hash_frag(fq->id, &fq->saddr, &fq->daddr, ip6_frags.rnd);
 }
 
-int ip6_frag_match(struct inet_frag_queue *q, void *a)
+bool ip6_frag_match(struct inet_frag_queue *q, void *a)
 {
        struct frag_queue *fq;
        struct ip6_create_arg *arg = a;
 
        fq = container_of(q, struct frag_queue, q);
-       return (fq->id == arg->id && fq->user == arg->user &&
-                       ipv6_addr_equal(&fq->saddr, arg->src) &&
-                       ipv6_addr_equal(&fq->daddr, arg->dst));
+       return  fq->id == arg->id &&
+               fq->user == arg->user &&
+               ipv6_addr_equal(&fq->saddr, arg->src) &&
+               ipv6_addr_equal(&fq->daddr, arg->dst);
 }
 EXPORT_SYMBOL(ip6_frag_match);