netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Fengguang Wu <fengguang.wu@intel.com>
Cc: walter harms <wharms@bfs.de>,
	netfilter-devel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] netfilter: PTR_RET can be used
Date: Mon, 20 Aug 2012 16:51:44 +0200	[thread overview]
Message-ID: <20120820145144.GA18676@1984> (raw)
In-Reply-To: <20120729121449.GA16489@localhost>

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.

      reply	other threads:[~2012-08-20 14:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-29  0:45 [PATCH] netfilter: PTR_RET can be used Fengguang Wu
2012-07-29 12:09 ` walter harms
2012-07-29 12:14   ` Fengguang Wu
2012-08-20 14:51     ` Pablo Neira Ayuso [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120820145144.GA18676@1984 \
    --to=pablo@netfilter.org \
    --cc=fengguang.wu@intel.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=wharms@bfs.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).