From: Bjorn Helgaas <bhelgaas@google.com>
To: Quentin Lambert <lambert.quentin@gmail.com>
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
julia.lawall@lip6.fr, fengguang.wu@intel.com,
Srikanth Thokala <sriku.linux@gmail.com>
Subject: Re: [PATCH v2] PCI: remove an unnecessary if condition before a return statement
Date: Mon, 10 Nov 2014 21:13:46 -0700 [thread overview]
Message-ID: <20141111041346.GE28161@google.com> (raw)
In-Reply-To: <20141107080639.GA22912@wrath>
[+cc Srikanth]
On Fri, Nov 07, 2014 at 09:06:39AM +0100, 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 <lambert.quentin@gmail.com>
Applied to pci/misc for v3.19, thanks!
I have no idea what it means, but I did add back the comment as Srikanth
pointed out.
> ---
>
> 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();
> }
>
> /********************************************************************************
> 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
>
prev parent reply other threads:[~2014-11-11 4:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-07 8:06 [PATCH v2] PCI: remove an unnecessary if condition before a return statement Quentin Lambert
2014-11-07 15:40 ` Srikanth Thokala
2014-11-11 4:13 ` Bjorn Helgaas [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=20141111041346.GE28161@google.com \
--to=bhelgaas@google.com \
--cc=fengguang.wu@intel.com \
--cc=julia.lawall@lip6.fr \
--cc=lambert.quentin@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=sriku.linux@gmail.com \
/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).