[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20120820145144.GA18676@1984>
Date: Mon, 20 Aug 2012 16:51:44 +0200
From: Pablo Neira Ayuso <pablo@...filter.org>
To: Fengguang Wu <fengguang.wu@...el.com>
Cc: walter harms <wharms@....de>, netfilter-devel@...r.kernel.org,
kernel-janitors@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] netfilter: PTR_RET can be used
On Sun, Jul 29, 2012 at 08:14:49PM +0800, Fengguang Wu wrote:
> > > --- linux.orig/net/bridge/netfilter/ebtable_filter.c 2012-07-29 08:41:09.703759534 +0800
> > > +++ linux/net/bridge/netfilter/ebtable_filter.c 2012-07-29 08:41:14.255759643 +0800
> > > @@ -100,9 +100,7 @@ static struct nf_hook_ops ebt_ops_filter
> > > static int __net_init frame_filter_net_init(struct net *net)
> > > {
> > > net->xt.frame_filter = ebt_register_table(net, &frame_filter);
> > > - if (IS_ERR(net->xt.frame_filter))
> > > - return PTR_ERR(net->xt.frame_filter);
> > > - return 0;
> > > + return PTR_RET(net->xt.frame_filter);
> > > }
> > >
> >
> > i do not understand this,
> > ebt_register_table() return (struct ebt_table *) on success
> >
> > Does PTR_RET really return 0 if this is a propper pointer ?
>
> Right. Here is how PTR_RET defined. This patch does not change any behavior.
>
> static inline int __must_check PTR_RET(const void *ptr)
> {
> if (IS_ERR(ptr))
> return PTR_ERR(ptr);
> else
> return 0;
> }
Applied, thanks Fengguang.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists