lkml.org 
[lkml]   [2014]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH v2] PCI: remove an unnecessary if condition before a return statement
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>
---

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


\
 
 \ /
  Last update: 2014-11-07 09:41    [W:0.040 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site