ip_frag: struct inet_frags match() method returns a bool

- 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>
This commit is contained in:
Eric Dumazet 2012-05-18 05:57:13 +02:00 committed by David S. Miller
parent 28e85100ae
commit cbc264cacd
4 changed files with 12 additions and 12 deletions

View File

@ -46,8 +46,7 @@ struct inet_frags {
void *arg); void *arg);
void (*destructor)(struct inet_frag_queue *); void (*destructor)(struct inet_frag_queue *);
void (*skb_free)(struct sk_buff *); void (*skb_free)(struct sk_buff *);
int (*match)(struct inet_frag_queue *q, bool (*match)(struct inet_frag_queue *q, void *arg);
void *arg);
void (*frag_expire)(unsigned long data); void (*frag_expire)(unsigned long data);
}; };

View File

@ -387,7 +387,7 @@ struct ip6_create_arg {
}; };
void ip6_frag_init(struct inet_frag_queue *q, void *a); 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) static inline int ipv6_addr_any(const struct in6_addr *a)
{ {

View File

@ -148,7 +148,7 @@ static unsigned int ip4_hashfn(struct inet_frag_queue *q)
return ipqhashfn(ipq->id, ipq->saddr, ipq->daddr, ipq->protocol); 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 ipq *qp;
struct ip4_create_arg *arg = a; struct ip4_create_arg *arg = a;

View 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); 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 frag_queue *fq;
struct ip6_create_arg *arg = a; struct ip6_create_arg *arg = a;
fq = container_of(q, struct frag_queue, q); fq = container_of(q, struct frag_queue, q);
return (fq->id == arg->id && fq->user == arg->user && return fq->id == arg->id &&
fq->user == arg->user &&
ipv6_addr_equal(&fq->saddr, arg->src) && ipv6_addr_equal(&fq->saddr, arg->src) &&
ipv6_addr_equal(&fq->daddr, arg->dst)); ipv6_addr_equal(&fq->daddr, arg->dst);
} }
EXPORT_SYMBOL(ip6_frag_match); EXPORT_SYMBOL(ip6_frag_match);