All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bhelgaas@google.com>
To: Tobias Klauser <tklauser@distanz.ch>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH] PCI: Remove unnecessary variable in pci_add_dynid()
Date: Wed, 3 Sep 2014 12:43:19 -0600	[thread overview]
Message-ID: <20140903184319.GC26073@google.com> (raw)
In-Reply-To: <1406277374-559-1-git-send-email-tklauser@distanz.ch>

On Fri, Jul 25, 2014 at 10:36:14AM +0200, Tobias Klauser wrote:
> The variable retval in pci_add_dynid() is only used to store the return
> value of driver_attach() and is then directly returned. Remove the
> variable and directly pass on driver_attach()'s return value.
> 
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

Applied to pci/misc for v3.18, thanks!

> ---
>  drivers/pci/pci-driver.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
> index d04c5ad..2b3c894 100644
> --- a/drivers/pci/pci-driver.c
> +++ b/drivers/pci/pci-driver.c
> @@ -55,7 +55,6 @@ int pci_add_dynid(struct pci_driver *drv,
>  		  unsigned long driver_data)
>  {
>  	struct pci_dynid *dynid;
> -	int retval;
>  
>  	dynid = kzalloc(sizeof(*dynid), GFP_KERNEL);
>  	if (!dynid)
> @@ -73,9 +72,7 @@ int pci_add_dynid(struct pci_driver *drv,
>  	list_add_tail(&dynid->node, &drv->dynids.list);
>  	spin_unlock(&drv->dynids.lock);
>  
> -	retval = driver_attach(&drv->driver);
> -
> -	return retval;
> +	return driver_attach(&drv->driver);
>  }
>  EXPORT_SYMBOL_GPL(pci_add_dynid);
>  
> -- 
> 2.0.1
> 
> 

      reply	other threads:[~2014-09-03 18:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-25  8:36 [PATCH] PCI: Remove unnecessary variable in pci_add_dynid() Tobias Klauser
2014-09-03 18:43 ` 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=20140903184319.GC26073@google.com \
    --to=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=tklauser@distanz.ch \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.