mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [2.6 patch] pci/pcie/aer/aerdrv_acpi.c: remove unneeded NULL check
@ 2008-03-30 22:41 Adrian Bunk
  0 siblings, 0 replies; 2+ messages in thread
From: Adrian Bunk @ 2008-03-30 22:41 UTC (permalink / raw)
  To: Greg KH; +Cc: Andrew Patterson, linux-kernel, linux-pci

There's no reason for checking pdev->bus for being NULL here (and we'd 
anyway Oops 3 lines below if it was).

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---

This patch has been sent on:
- 22 Feb 2008

74832021c82be6e2ed6055f4f25dbf152df67cf5 diff --git a/drivers/pci/pcie/aer/aerdrv_acpi.c b/drivers/pci/pcie/aer/aerdrv_acpi.c
index 8c199ae..1e2a858 100644
--- a/drivers/pci/pcie/aer/aerdrv_acpi.c
+++ b/drivers/pci/pcie/aer/aerdrv_acpi.c
@@ -34,7 +34,7 @@ int aer_osc_setup(struct pcie_device *pciedev)
 	acpi_handle handle = 0;
 
 	/* Find root host bridge */
-	while (pdev->bus && pdev->bus->self)
+	while (pdev->bus->self)
 		pdev = pdev->bus->self;
 	handle = acpi_get_pci_rootbridge_handle(
 		pci_domain_nr(pdev->bus), pdev->bus->number);


^ permalink raw reply	[flat|nested] 2+ messages in thread
* pci/pcie/aer/aerdrv_acpi.c: inconsequent NULL checking
@ 2008-02-19 19:29 Adrian Bunk
  2008-02-20  5:47 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Adrian Bunk @ 2008-02-19 19:29 UTC (permalink / raw)
  To: Andrew Patterson, Greg Kroah-Hartman; +Cc: linux-kernel, linux-pci

The Coverity checker spotted the following inconsequent NULL checking 
introduced by commit 3c75e23784e6ed5f4841de43d0750fd9b37bafcb:

<--  snip  -->

...
int aer_osc_setup(struct pcie_device *pciedev)
{
...            vvvvvvvvv
        while (pdev->bus && pdev->bus->self)
                pdev = pdev->bus->self;
        handle = acpi_get_pci_rootbridge_handle(
                pci_domain_nr(pdev->bus), pdev->bus->number);
...                                       ^^^^^^^^^^^^^^^^^

<--  snip  -->

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-03-30 22:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-30 22:41 [2.6 patch] pci/pcie/aer/aerdrv_acpi.c: remove unneeded NULL check Adrian Bunk
  -- strict thread matches above, loose matches on Subject: below --
2008-02-19 19:29 pci/pcie/aer/aerdrv_acpi.c: inconsequent NULL checking Adrian Bunk
2008-02-20  5:47 ` Greg KH
2008-02-20  7:56   ` Adrian Bunk
2008-02-20 16:09     ` Greg KH
2008-02-22 19:58       ` [2.6 patch] pci/pcie/aer/aerdrv_acpi.c: remove unneeded NULL check Adrian Bunk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®