From patchwork Mon Oct 29 00:55:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kbuild test robot X-Patchwork-Id: 194772 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 16F5B2C0086 for ; Mon, 29 Oct 2012 11:55:55 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755033Ab2J2Azo (ORCPT ); Sun, 28 Oct 2012 20:55:44 -0400 Received: from mga01.intel.com ([192.55.52.88]:24465 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751612Ab2J2Azo (ORCPT ); Sun, 28 Oct 2012 20:55:44 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 28 Oct 2012 17:55:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,668,1344236400"; d="scan'208";a="241310272" Received: from unknown (HELO wfg-t420.sh.intel.com) ([10.255.21.93]) by fmsmga002.fm.intel.com with ESMTP; 28 Oct 2012 17:55:42 -0700 Received: from wfg by wfg-t420.sh.intel.com with local (Exim 4.77) (envelope-from ) id 1TSddm-0003y2-C0; Mon, 29 Oct 2012 08:55:42 +0800 Date: Mon, 29 Oct 2012 08:55:42 +0800 From: Fengguang Wu To: Pablo Neira Ayuso Cc: Patrick McHardy , netfilter-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] netfilter: ipv6: use PTR_RET Message-ID: <20121029005542.GA14313@localhost> References: <20121029004044.GA12982@localhost> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20121029004044.GA12982@localhost> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Use PTR_RET rather than if(IS_ERR(...)) + PTR_ERR Generated by: coccinelle/api/ptr_ret.cocci Signed-off-by: Fengguang Wu --- net/ipv6/netfilter/ip6table_nat.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- linux-next.orig/net/ipv6/netfilter/ip6table_nat.c 2012-10-23 09:44:52.637430993 +0800 +++ linux-next/net/ipv6/netfilter/ip6table_nat.c 2012-10-29 08:53:41.579243556 +0800 @@ -275,9 +275,7 @@ static int __net_init ip6table_nat_net_i return -ENOMEM; net->ipv6.ip6table_nat = ip6t_register_table(net, &nf_nat_ipv6_table, repl); kfree(repl); - if (IS_ERR(net->ipv6.ip6table_nat)) - return PTR_ERR(net->ipv6.ip6table_nat); - return 0; + return PTR_RET(net->ipv6.ip6table_nat); } static void __net_exit ip6table_nat_net_exit(struct net *net)