From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org ([198.145.29.136]:47277 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933424AbcAKOmR (ORCPT ); Mon, 11 Jan 2016 09:42:17 -0500 Date: Mon, 11 Jan 2016 08:42:14 -0600 From: Bjorn Helgaas To: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, Julia Lawall , Fengguang Wu , Geliang Tang Subject: Re: [PATCH] PCI: ibmphp: Remove unneeded NULL test Message-ID: <20160111144214.GA25540@localhost> References: <20160111143157.25347.46282.stgit@bhelgaas-glaptop2.roam.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20160111143157.25347.46282.stgit@bhelgaas-glaptop2.roam.corp.google.com> Sender: linux-pci-owner@vger.kernel.org List-ID: On Mon, Jan 11, 2016 at 08:31:57AM -0600, Bjorn Helgaas wrote: > From: Julia Lawall > > 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 > Signed-off-by: Julia Lawall > Signed-off-by: Bjorn Helgaas > CC: Geliang Tang 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