Re: [GIT PATCH] PCI patches for 2.6.24

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Greg KH <gregkh@...>
Cc: <torvalds@...>, <linux-kernel@...>, <linux-pci@...>, <pcihpd-discuss@...>, Li, Shaohua <shaohua.li@...>, <yanmin.zhang@...>
Date: Friday, February 1, 2008 - 8:42 pm

On Fri, 1 Feb 2008 15:11:47 -0800
Greg KH <gregkh@suse.de> wrote:


drivers/built-in.o: In function `pci_scan_slot':
drivers/pci/probe.c:1016: undefined reference to `pcie_aspm_init_link_state'
drivers/built-in.o: In function `pci_stop_dev':
drivers/pci/remove.c:36: undefined reference to `pcie_aspm_exit_link_state'
drivers/built-in.o: In function `pci_set_power_state':
drivers/pci/pci.c:524: undefined reference to `pcie_aspm_pm_state_change'
make: *** [.tmp_vmlinux1] Error 1

http://userweb.kernel.org/~akpm/config-vmm.txt


Needs this, I guess:


--- a/drivers/pci/pcie/Kconfig~fix-gregkh-pci-pci-pcie-aspm-support
+++ a/drivers/pci/pcie/Kconfig
@@ -32,7 +32,7 @@ source "drivers/pci/pcie/aer/Kconfig"
 #
 config PCIEASPM
 	bool "PCI Express ASPM support(Experimental)"
-	depends on PCI && EXPERIMENTAL
+	depends on PCI && EXPERIMENTAL && PCIEPORTBUS
 	default y
 	help
 	  This enables PCI Express ASPM (Active State Power Management) and
_


Also, that ASPM patch unnecessarily adds a pile of macros:

+#ifdef CONFIG_PCIEASPM
+extern void pcie_aspm_init_link_state(struct pci_dev *pdev);
+extern void pcie_aspm_exit_link_state(struct pci_dev *pdev);
+extern void pcie_aspm_pm_state_change(struct pci_dev *pdev);
+extern void pci_disable_link_state(struct pci_dev *pdev, int state);
+#else
+#define pcie_aspm_init_link_state(pdev)                do {} while (0)
+#define pcie_aspm_exit_link_state(pdev)                do {} while (0)
+#define pcie_aspm_pm_state_change(pdev)                do {} while (0)
+#define pci_disable_link_state(pdev, state)    do {} while (0)
+#endif

Please don't do this.  

A static inline function is cleaner and provides typechecking.  It also
provides an access to the caller's argument and can avoid unused-varaiable
warnings.

The only reason to use a macro in this situation is if the caller's
argument is for some reason not defined if !CONFIG_PCIEASPM.

Greg, please check for this in your reviewing - reject macros *by default*.
 They are inferior.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[GIT PATCH] PCI patches for 2.6.24, Greg KH, (Fri Feb 1, 7:11 pm)
Re: [patch] pci: pci_enable_device_bars() fix, Jeff Garzik, (Sat Feb 2, 4:56 pm)
Re: [patch] pci: pci_enable_device_bars() fix, Greg KH, (Sat Feb 2, 7:23 pm)
Re: [patch] pci: pci_enable_device_bars() fix, Jeff Garzik, (Sat Feb 2, 11:51 am)
Re: [patch] pci: pci_enable_device_bars() fix, Ingo Molnar, (Sat Feb 2, 1:08 pm)
Re: [patch] pci: pci_enable_device_bars() fix, James Bottomley, (Sat Feb 2, 2:08 pm)
Re: [patch] pci: pci_enable_device_bars() fix, Ingo Molnar, (Sat Feb 2, 3:00 pm)
Re: [patch] pci: pci_enable_device_bars() fix, Jeff Garzik, (Sat Feb 2, 1:33 pm)
Re: [patch] pci: pci_enable_device_bars() fix, Ingo Molnar, (Sat Feb 2, 1:57 pm)
Re: [patch] pci: pci_enable_device_bars() fix, Jeff Garzik, (Sat Feb 2, 2:49 pm)
Re: [patch] pci: pci_enable_device_bars() fix, Ingo Molnar, (Sat Feb 2, 3:35 pm)
Re: [patch] pci: pci_enable_device_bars() fix, Jeff Garzik, (Sat Feb 2, 4:48 pm)
Re: [patch] pci: pci_enable_device_bars() fix, Ingo Molnar, (Mon Feb 4, 8:57 am)
Re: [patch] pci: pci_enable_device_bars() fix, Jeff Garzik, (Mon Feb 4, 11:30 am)
Re: [patch] pci: pci_enable_device_bars() fix, Andrew Morton, (Mon Feb 4, 9:12 am)
Re: [patch] pci: pci_enable_device_bars() fix, Jeff Garzik, (Mon Feb 4, 11:32 am)
Re: [patch] pci: pci_enable_device_bars() fix, James Bottomley, (Sat Feb 2, 12:01 pm)
Re: [GIT PATCH] PCI patches for 2.6.24, Andrew Morton, (Fri Feb 1, 8:42 pm)
Re: [GIT PATCH] PCI patches for 2.6.24, Greg KH, (Fri Feb 1, 8:49 pm)
Re: [GIT PATCH] PCI patches for 2.6.24, Andrew Morton, (Fri Feb 1, 9:07 pm)