* [PATCH] PCI: Remove unnecessary variable in pci_add_dynid()
@ 2014-07-25 8:36 Tobias Klauser
2014-09-03 18:43 ` Bjorn Helgaas
0 siblings, 1 reply; 2+ messages in thread
From: Tobias Klauser @ 2014-07-25 8:36 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: linux-pci
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>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] PCI: Remove unnecessary variable in pci_add_dynid()
2014-07-25 8:36 [PATCH] PCI: Remove unnecessary variable in pci_add_dynid() Tobias Klauser
@ 2014-09-03 18:43 ` Bjorn Helgaas
0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2014-09-03 18:43 UTC (permalink / raw)
To: Tobias Klauser; +Cc: linux-pci
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
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-09-03 18:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-25 8:36 [PATCH] PCI: Remove unnecessary variable in pci_add_dynid() Tobias Klauser
2014-09-03 18:43 ` Bjorn Helgaas
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).