Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751739AbaKGPkY (ORCPT ); Fri, 7 Nov 2014 10:40:24 -0500 Received: from mail-la0-f41.google.com ([209.85.215.41]:37652 "EHLO mail-la0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751480AbaKGPkV (ORCPT ); Fri, 7 Nov 2014 10:40:21 -0500 MIME-Version: 1.0 In-Reply-To: <20141107080639.GA22912@wrath> References: <20141107080639.GA22912@wrath> Date: Fri, 7 Nov 2014 21:10:20 +0530 Message-ID: Subject: Re: [PATCH v2] PCI: remove an unnecessary if condition before a return statement From: Srikanth Thokala To: Quentin Lambert Cc: Bjorn Helgaas , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , julia.lawall@lip6.fr, fengguang.wu@intel.com Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Quentin, On Fri, Nov 7, 2014 at 1:36 PM, Quentin Lambert wrote: > 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 > --- > > Changes in v2: > - remove a checkpatch warning due to the a space between after the > function name. > > 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..2da59ef 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(); I think we need to retain the comment? - Srikanth > } > > /******************************************************************************** > 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 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-pci" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/