[PATCH][BUILD FAILURE 03/12] Re: Next April 21 : PPC64 randconfig [arch/powerpc/kernel/of_platform.o]

From: Subrata Modak
Date: Wed Apr 22 2009 - 12:17:21 EST


On Wed, 2009-04-22 at 00:20 +0530, Subrata Modak wrote:
> Reported this earlier on 14th April 2009:
> http://lkml.org/lkml/2009/4/14/480,
>
> Michael,
>
> Any fix in sight ?
> http://lkml.org/lkml/2009/4/14/676,
>
> CC arch/powerpc/kernel/of_platform.o
> arch/powerpc/kernel/of_platform.c: In function 'of_pci_phb_probe':
> arch/powerpc/kernel/of_platform.c:270: error: implicit declaration of
> function 'pci_devs_phb_init_dynamic'
> arch/powerpc/kernel/of_platform.c:279: error: implicit declaration of
> function 'scan_phb'
> arch/powerpc/kernel/of_platform.c:295: error: implicit declaration of
> function 'pci_bus_add_devices'
> make[1]: *** [arch/powerpc/kernel/of_platform.o] Error 1
> make: *** [arch/powerpc/kernel] Error 2
> ---

Well, 'pci_devs_phb_init_dynamic', 'scan_phb' & 'pci_bus_add_devices'
has been defined at ./arch/powerpc/include/asm/ppc-pci.h, but as
#ifdef CONFIG_PCI
the reason for which the declarations were not visible. And these
would churn out few additional failures also for PPC build, like:

CC arch/powerpc/kernel/pci_dn.o
arch/powerpc/kernel/pci_dn.c:82: error: expected declaration specifiers or â??...â?? before â??traverse_funcâ??
arch/powerpc/kernel/pci_dn.c: In function â??traverse_pci_devicesâ??:
arch/powerpc/kernel/pci_dn.c:97: error: â??preâ?? undeclared (first use in this function)
arch/powerpc/kernel/pci_dn.c:97: error: (Each undeclared identifier is reported only once
arch/powerpc/kernel/pci_dn.c:97: error: for each function it appears in.)
arch/powerpc/kernel/pci_dn.c:97: error: implicit declaration of function â??preâ??
arch/powerpc/kernel/pci_dn.c:97: warning: assignment makes pointer from integer without a cast
arch/powerpc/kernel/pci_dn.c: In function â??pci_devs_phb_init_dynamicâ??:
arch/powerpc/kernel/pci_dn.c:143: error: too many arguments to function â??traverse_pci_devicesâ??
arch/powerpc/kernel/pci_dn.c: In function â??fetch_dev_dnâ??:
arch/powerpc/kernel/pci_dn.c:180: error: too many arguments to function â??traverse_pci_devicesâ??
arch/powerpc/kernel/pci_dn.c: In function â??pci_devs_phb_initâ??:
arch/powerpc/kernel/pci_dn.c:224: error: â??hose_listâ?? undeclared (first use in this function)
make[1]: *** [arch/powerpc/kernel/pci_dn.o] Error 1
make: *** [arch/powerpc/kernel/pci_dn.o] Error 2
---
CC arch/powerpc/platforms/pseries/pci_dlpar.o
arch/powerpc/platforms/pseries/pci_dlpar.c: In function â??pcibios_remove_pci_devicesâ??:
arch/powerpc/platforms/pseries/pci_dlpar.c:88: error: implicit declaration of function â??pci_remove_bus_deviceâ??
arch/powerpc/platforms/pseries/pci_dlpar.c: In function â??pcibios_add_pci_devicesâ??:
arch/powerpc/platforms/pseries/pci_dlpar.c:121: error: implicit declaration of function â??pci_scan_slotâ??
arch/powerpc/platforms/pseries/pci_dlpar.c:130: error: implicit declaration of function â??pci_scan_bridgeâ??
arch/powerpc/platforms/pseries/pci_dlpar.c: In function â??init_phb_dynamicâ??:
arch/powerpc/platforms/pseries/pci_dlpar.c:146: error: implicit declaration of function â??rtas_setup_phbâ??
arch/powerpc/platforms/pseries/pci_dlpar.c:149: error: implicit declaration of function â??pci_devs_phb_init_dynamicâ??
arch/powerpc/platforms/pseries/pci_dlpar.c:154: error: implicit declaration of function â??scan_phbâ??
arch/powerpc/platforms/pseries/pci_dlpar.c: In function â??remove_phb_dynamicâ??:
arch/powerpc/platforms/pseries/pci_dlpar.c:191: error: implicit declaration of function â??pci_remove_busâ??
make[1]: *** [arch/powerpc/platforms/pseries/pci_dlpar.o] Error 1
make: *** [arch/powerpc/platforms/pseries/pci_dlpar.o] Error 2
---

The following patch attempts to fix them all. I had tested them. Please review.

Signed-Off-By: Subrata Modak <subrata@xxxxxxxxxxxxxxxxxx>,
To: Paul Mackerras <paulus@xxxxxxxxx>
To: Linuxppc-dev <Linuxppc-dev@xxxxxxxxxx>
Cc: Michael Ellerman <michael@xxxxxxxxxxxxxx>
Cc: Balbir Singh <balbir@xxxxxxxxxxxxxxxxxx>
Cc: Sachin P Sant <sachinp@xxxxxxxxxxxxxxxxxx>
Cc: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>
Cc: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
Cc: linux-next <linux-next@xxxxxxxxxxxxxxx>
Cc: linux-kernel <linux-kernel@xxxxxxxxxxxxxxx>
Cc: Alexander Beregalov <a.beregalov@xxxxxxxxx>
---

--- linux-2.6.30-rc2-next20090421-randconfig/arch/powerpc/kernel/of_platform.c.orig 2009-04-22 09:50:32.000000000 -0500
+++ linux-2.6.30-rc2-next20090421-randconfig/arch/powerpc/kernel/of_platform.c 2009-04-22 10:06:52.000000000 -0500
@@ -230,7 +230,7 @@ struct of_device *of_find_device_by_phan
EXPORT_SYMBOL(of_find_device_by_phandle);


-#ifdef CONFIG_PPC_OF_PLATFORM_PCI
+#if defined(CONFIG_PPC_OF_PLATFORM_PCI) && defined(CONFIG_PCI)

/* The probing of PCI controllers from of_platform is currently
* 64 bits only, mostly due to gratuitous differences between
--- linux-2.6.30-rc2-next20090421-randconfig/arch/powerpc/kernel/pci_dn.c.orig 2009-04-22 10:07:21.000000000 -0500
+++ linux-2.6.30-rc2-next20090421-randconfig/arch/powerpc/kernel/pci_dn.c 2009-04-22 10:09:10.000000000 -0500
@@ -35,6 +35,8 @@
* Traverse_func that inits the PCI fields of the device node.
* NOTE: this *must* be done before read/write config to the device.
*/
+
+#ifdef CONFIG_PCI
static void * __devinit update_dn_pci_info(struct device_node *dn, void *data)
{
struct pci_controller *phb = data;
@@ -226,3 +228,4 @@ void __init pci_devs_phb_init(void)

pSeries_reconfig_notifier_register(&pci_dn_reconfig_nb);
}
+#endif
--- linux-2.6.30-rc2-next20090421-randconfig/arch/powerpc/platforms/pseries/pci_dlpar.c.orig 2009-04-22 10:10:26.000000000 -0500
+++ linux-2.6.30-rc2-next20090421-randconfig/arch/powerpc/platforms/pseries/pci_dlpar.c 2009-04-22 10:12:23.000000000 -0500
@@ -33,6 +33,7 @@
#include <asm/firmware.h>
#include <asm/eeh.h>

+#ifdef CONFIG_PCI
static struct pci_bus *
find_bus_among_children(struct pci_bus *bus,
struct device_node *dn)
@@ -208,3 +209,4 @@ int remove_phb_dynamic(struct pci_contro
return 0;
}
EXPORT_SYMBOL_GPL(remove_phb_dynamic);
+#endif

---
Regards--
Subrata

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/