From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751537AbaKFQly (ORCPT ); Thu, 6 Nov 2014 11:41:54 -0500 Received: from mail-wg0-f48.google.com ([74.125.82.48]:49006 "EHLO mail-wg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751245AbaKFQlu (ORCPT ); Thu, 6 Nov 2014 11:41:50 -0500 Date: Thu, 6 Nov 2014 17:45:55 +0100 From: Quentin Lambert To: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, julia.lawall@lip6.fr, fengguang.wu@intel.com Subject: [PATCH] PCI: remove an unnecessary if condition before a return statement Message-ID: <20141106164555.GA19353@wrath> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Simplify a trivial if-return sequence. Possibly combine with a preceding function call. Generated by: scripts/coccinelle/misc/simple_return.cocci Signed-off-by: Quentin Lambert --- I ran coccinelle on the whole directory and the only other match was drivers/pci/host/pci-imx6.c, but the current version does not seem to be compiling. drivers/pci/hotplug/ibmphp_res.c | 5 +---- drivers/pci/pci.c | 6 +----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/pci/hotplug/ibmphp_res.c b/drivers/pci/hotplug/ibmphp_res.c index 219ba80..db5cb8d 100644 --- a/drivers/pci/hotplug/ibmphp_res.c +++ b/drivers/pci/hotplug/ibmphp_res.c @@ -376,10 +376,7 @@ int __init ibmphp_rsrc_init (void) if (rc) return rc; } - rc = once_over (); /* This is to align ranges (so no -1) */ - if (rc) - return rc; - return 0; + return once_over (); } /******************************************************************************** diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 625a4ac..9a5871f 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -1012,11 +1012,7 @@ int pci_save_state(struct pci_dev *dev) if (i != 0) return i; - i = pci_save_vc_state(dev); - if (i != 0) - return i; - - return 0; + return pci_save_vc_state(dev); } EXPORT_SYMBOL(pci_save_state); -- 1.9.1