Re: [PATCH 1/2] pdc202xx_new: fix PCI refcounting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sunday 26 August 2007, Sergei Shtylyov wrote:
> Bartlomiej Zolnierkiewicz wrote:
> 
> >>The driver erroneously "lets go" the mate IDE chip in init_setup_pdc20270()
> >>when ide_setup_pci_devices() call succeeds -- fix this, and drop a couple of
> >>useless assignments in this function while at it...
> 
> >>Signed-off-by: Sergei Shtylyov <sshtylyov@xxxxxxxxxxxxx>
> 
> > applied but
> 
> >>---
> >>This patch is against the current Linus' tree, it has only been compile tested
> >>since I do not have PDC2027x chips (and even less so behind DC21150 bridge :-).
> 
> >>Index: linux-2.6/drivers/ide/pci/pdc202xx_new.c
> >>===================================================================
> >>--- linux-2.6.orig/drivers/ide/pci/pdc202xx_new.c
> >>+++ linux-2.6/drivers/ide/pci/pdc202xx_new.c
> [...]
> >>@@ -521,7 +521,7 @@ static int __devinit init_setup_pdcnew(s
> >> static int __devinit init_setup_pdc20270(struct pci_dev *dev,
> >> 					 ide_pci_device_t *d)
> >> {
> >>-	struct pci_dev *findev = NULL;
> >>+	struct pci_dev *findev;
> 
> > drivers/ide/pci/pdc202xx_new.c: In function ‘init_setup_pdc20270’:
> > drivers/ide/pci/pdc202xx_new.c:530: warning: ‘findev’ may be used uninitialized in this function
> 
> > with gcc version 4.1.2 20070626 (Red Hat 4.1.2-13)
> 
> > Seems to be gcc problem
> 
>     No, it must be all those pills I'm taking... ;-)
> 
> > but I reverted this chunk.
> 
>     And you were absolutely right -- findev must be NULL for the search to go 
> thru all the PCI devices. :-/
> 
> > Update: after applying patch #2/2 and fixing the reject caused by the above change
> > warning disappears (patch #2/2 besides renaming "findev" to "dev2" moves the code
> > around making it easier for gcc to deduce what is going on :).
> 
>     Right, because pci_get_slot() is not a "device scanner" and so doesn't 
> need the starting node.

This nicely explains the issue.

>     I guess there's no need to recast now?

Yep, no need for recast.

The patch was corrected by me while applying it to IDE tree.

Bart
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux