[PATCH] x86: Intel-perf_event: Delete an unnecessary check before the function call "pci_dev_put"

SF Markus Elfring
2015-02-03T11:48:44Z

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 3 Feb 2015 12:40:54 +0100

The pci_dev_put() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
arch/x86/kernel/cpu/perf_event_intel_uncore_snbep.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore_snbep.c b/arch/x86/kernel/cpu/perf_event_intel_uncore_snbep.c
index 21af6149e..12d9548 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore_snbep.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore_snbep.c
@@ -1132,8 +1132,7 @@ static int snbep_pci2phy_map_init(int devid)
}
}

- if (ubox_dev)
- pci_dev_put(ubox_dev);
+ pci_dev_put(ubox_dev);

return err ? pcibios_err_to_errno(err) : 0;
}
--
2.2.2