Re: netfilter: add a typedef for the recurring okfn use

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Le samedi 15 janvier 2011 Ã 15:45 +0100, Patrick McHardy a Ãcrit :
> Am 15.01.2011 15:34, schrieb Pablo Neira Ayuso:
> > On 14/01/11 22:54, Jan Engelhardt wrote:

> >>  
> >> +typedef int (*nf_okfn_t)(struct sk_buff *);
> >>  typedef unsigned int nf_hookfn(unsigned int hooknum,
> >>  			       struct sk_buff *skb,
> >>  			       const struct net_device *in,
> >>  			       const struct net_device *out,
> >> -			       int (*okfn)(struct sk_buff *));
> >> +			       nf_okfn_t okfn);
> > 
> > This typedef makes the source code less readable in my opinion. You have
> > to look for nf_okfn_t to look what it actually is.
> 
> I agree. This also violates the CodingStyle rules for use of typedefs.
> 

I had to add typedefs only because of the __rcu game, in apparent
violation of Linus rule (not adding typedefs), because of sparse or
compiler limitations.

int br_should_route_hook_t(struct sk_buff *skb); 
br_should_route_hook_t __rcu *br_should_route_hook __read_mostly;

I also prefer to read :

int (*okfn)(struct sk_buff *) 

instead of 

nf_okfn_t okfn



--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux