Skip to contentSkip to conversation

Fix compiler warnings for 2.6.23-rc8 on x86_64

PATCH Maarten Bressers 2 participants 2 messages Sep 29, 2007

lore
Share & tools
lore
#0 lore raw
Quoted 37 lines · On Fri, 28 Sep 2007 15:49:26 -0700 Greg KH <[email protected]> wrote:
Quoted 12 lines · Maarten Bressers

This (trivial) patch fixes two compiler warnings for 2.6.23-rc8 on x86_64, use of deprecated function pci_find_device() and a section mismatch. Build log and .config file included.

Signed-off by: Maarten Bressers <[email protected]>

drivers/pci/search.c +0 -0
index c6e79d0..0eb7e9e 100644

drivers/pci/search.c pci_find_slot(unsigned int bus, unsigned int devfn) · line 102

Quoted 8 lines
drivers/pci/search.c +1 -1
@@ -96,7 +96,7 @@ pci_find_slot(unsigned int bus, unsigned int devfn)
 {
 	struct pci_dev *dev = NULL;
 
-	while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+	while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
 		if (dev->bus->number == bus && dev->devfn == devfn)
 			return dev;
 	}

This is not a trivial patch, it changes the behavior of the code and is buggy.

Please read the documentationfor pci_get_device() on how to use it properly. It can not be used in pci_find_slot() as the reference counting will be all wrong. You need to just work to get rid of pci_find_slot() and then remove the whole function to get rid of the warning :)

drivers/pci/search.c

Quoted 2 lines
drivers/pci/search.c +0 -2
-EXPORT_SYMBOL(pci_find_device);
-EXPORT_SYMBOL(pci_find_slot);

What about the modules that want to use these functions? Are they all now gone? If so, just drop the whole function.

Quoted 3 lines

thanks,

greg k-h

Greg, thank you for your reply. It seems I'm out of my league here, I just thought I could quickly fix two compiler warnings, obviously this is not the case. I've read the documentation, but I don't think I'll be able to fix this. Sorry for the noise.

Randy, please ignore the other patch I sent you, it's obviously wrong.

#1 lore raw
Quoted 40 lines · Maarten Bressers
Quoted 37 lines · On Fri, 28 Sep 2007 15:49:26 -0700 Greg KH <[email protected]> wrote:
Quoted 12 lines · Maarten Bressers

This (trivial) patch fixes two compiler warnings for 2.6.23-rc8 on x86_64, use of deprecated function pci_find_device() and a section mismatch. Build log and .config file included.

Signed-off by: Maarten Bressers <[email protected]>

drivers/pci/search.c +0 -0
index c6e79d0..0eb7e9e 100644

drivers/pci/search.c pci_find_slot(unsigned int bus, unsigned int devfn) · line 102

Quoted 8 lines
drivers/pci/search.c +1 -1
@@ -96,7 +96,7 @@ pci_find_slot(unsigned int bus, unsigned int devfn)
 {
 	struct pci_dev *dev = NULL;
 
-	while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+	while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
 		if (dev->bus->number == bus && dev->devfn == devfn)
 			return dev;
 	}

This is not a trivial patch, it changes the behavior of the code and is buggy.

Please read the documentationfor pci_get_device() on how to use it properly. It can not be used in pci_find_slot() as the reference counting will be all wrong. You need to just work to get rid of pci_find_slot() and then remove the whole function to get rid of the warning :)

drivers/pci/search.c

Quoted 2 lines
drivers/pci/search.c +0 -2
-EXPORT_SYMBOL(pci_find_device);
-EXPORT_SYMBOL(pci_find_slot);

What about the modules that want to use these functions? Are they all now gone? If so, just drop the whole function.

Quoted 8 lines
Quoted 3 lines

thanks,

greg k-h

Greg, thank you for your reply. It seems I'm out of my league here, I just thought I could quickly fix two compiler warnings, obviously this is not the case. I've read the documentation, but I don't think I'll be able to fix this. Sorry for the noise.

No problem, and I don't mean to scare you away at all. If you want to work toward getting rid of all of the callers of the pci_find_slot() function, that would be best, and then the function can be deleted.

If you have questions on how to do that, feel free to ask.

thanks,

greg k-h