Re: -git tree build failure #2: drivers/net/cnic.c:2520: error: implicit declaration of function â__symbol_getâ

From: Ingo Molnar
Date: Sat Jun 13 2009 - 17:06:55 EST



* Ingo Molnar <mingo@xxxxxxx> wrote:

> I still had the window open that had the build failure:
>
> LD sound/pci/snd-es1968.o
> CC fs/btrfs/zlib.o
> drivers/net/cnic.c: In function âinit_bnx2_cnicâ:
> drivers/net/cnic.c:2524: error: implicit declaration of function
> â__symbol_getâ
> drivers/net/cnic.c:2524: warning: assignment makes pointer from
> integer without a cast
> distcc[22461] ERROR: compile drivers/net/cnic.c on ph/32 failed
> make[2]: *** [drivers/net/cnic.o] Error 1
> make[2]: *** Waiting for unfinished jobs....
> CC drivers/ide/trm290.o
> CC drivers/scsi/cxgb3i/cxgb3i_ddp.o
> LD sound/pci/snd-fm801.o
> CC net/sched/sch_drr.o
> CC fs/cifs/xattr.o
> CC drivers/scsi/mpt2sas/mpt2sas_base.o
>
> So it's real - even if the fix is bogus. But it's a different
> config - i'll now try to figure out which one it is and why the
> build fails ...

Yes, the bug is real - the fix is not.

Here is the code:

static struct cnic_dev *init_bnx2_cnic(struct net_device *dev)
{
struct pci_dev *pdev;
struct cnic_dev *cdev;
struct cnic_local *cp;
struct cnic_eth_dev *ethdev = NULL;
struct cnic_eth_dev *(*probe)(void *) = NULL;

probe = __symbol_get("bnx2_cnic_probe");
if (probe) {
ethdev = (*probe)(dev);
symbol_put_addr(probe);
}

and that's a very rare use of __symbol_get(). The problem is that
the cnic driver can be built into the kernel too (!CONFIG_MODULES)
but __symbol_get() is (obviously) a modules-code internal function
really. __symbol_get() is only defined in the CONFIG_MODULES section
of module.h.

Ingo
--
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/