* [PATCH] PCI: ibmphp: Remove unneeded NULL test
@ 2016-01-11 14:31 Bjorn Helgaas
2016-01-11 14:42 ` Bjorn Helgaas
0 siblings, 1 reply; 2+ messages in thread
From: Bjorn Helgaas @ 2016-01-11 14:31 UTC (permalink / raw)
To: linux-pci; +Cc: Julia Lawall, Fengguang Wu, Geliang Tang
From: Julia Lawall <julia.lawall@lip6.fr>
Remove unneeded NULL test. The index variable of list_for_each_entry is
never NULL, as it is the structure that contains the list pointer.
Generated by: scripts/coccinelle/iterators/itnull.cocci
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: Geliang Tang <geliangtang@163.com>
---
drivers/pci/hotplug/ibmphp_core.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c
index 010e46a..49adf22 100644
--- a/drivers/pci/hotplug/ibmphp_core.c
+++ b/drivers/pci/hotplug/ibmphp_core.c
@@ -503,9 +503,6 @@ static int __init init_ops(void)
int rc;
list_for_each_entry(slot_cur, &ibmphp_slot_head, ibm_slot_list) {
- if (!slot_cur)
- return -ENODEV;
-
debug("BEFORE GETTING SLOT STATUS, slot # %x\n",
slot_cur->number);
if (slot_cur->ctrl->revision == 0xFF)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] PCI: ibmphp: Remove unneeded NULL test
2016-01-11 14:31 [PATCH] PCI: ibmphp: Remove unneeded NULL test Bjorn Helgaas
@ 2016-01-11 14:42 ` Bjorn Helgaas
0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2016-01-11 14:42 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: linux-pci, Julia Lawall, Fengguang Wu, Geliang Tang
On Mon, Jan 11, 2016 at 08:31:57AM -0600, Bjorn Helgaas wrote:
> From: Julia Lawall <julia.lawall@lip6.fr>
>
> Remove unneeded NULL test. The index variable of list_for_each_entry is
> never NULL, as it is the structure that contains the list pointer.
>
> Generated by: scripts/coccinelle/iterators/itnull.cocci
>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> CC: Geliang Tang <geliangtang@163.com>
I applied this to pci/hotplug and plan to include it for v4.5. I'm just
resending it so it's on the linux-pci list.
> ---
> drivers/pci/hotplug/ibmphp_core.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c
> index 010e46a..49adf22 100644
> --- a/drivers/pci/hotplug/ibmphp_core.c
> +++ b/drivers/pci/hotplug/ibmphp_core.c
> @@ -503,9 +503,6 @@ static int __init init_ops(void)
> int rc;
>
> list_for_each_entry(slot_cur, &ibmphp_slot_head, ibm_slot_list) {
> - if (!slot_cur)
> - return -ENODEV;
> -
> debug("BEFORE GETTING SLOT STATUS, slot # %x\n",
> slot_cur->number);
> if (slot_cur->ctrl->revision == 0xFF)
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-01-11 14:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-11 14:31 [PATCH] PCI: ibmphp: Remove unneeded NULL test Bjorn Helgaas
2016-01-11 14:42 ` 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).