Skip to contentSkip to conversation

fix 3c515.c:(.text+0x57200): undefined reference to `pnp_get_resource'

PATCH In review Ingo Molnar 2 participants 3 messages Jun 20, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix 3c515.c:(.text+0x57200): undefined reference to `pnp_get_resource'

commit 2538003ce2ea0b936d273692bc4e51c5b52fe70d

Author: Ingo Molnar <[email protected]>
Date:   Fri Jun 20 11:29:31 2008 +0200

fix 3c515.c:(.text+0x57200): undefined reference to `pnp_get_resource'

-tip testing found the following build failure:

drivers/built-in.o: In function `corkscrew_setup':
3c515.c:(.text+0x57200): undefined reference to `pnp_get_resource'

which happens if 3c515.c is build without CONFIG_PNP:

http://redhat.com/~mingo/misc/config-Fri_Jun_20_10_02_43_CEST_2008.bad

the reason is pnp_irq() use outside of its __ISAPNP__ section.

corkscrew_setup() always called with NULL in the !__ISAPNP__ case, but also check this condition to make sure.

drivers/net/3c515.c +5 -0
index 105a8c7..09dd063 100644
@@ -573,7 +573,12 @@ static int corkscrew_setup(struct net_device *dev, int ioaddr,
 	DECLARE_MAC_BUF(mac);
 
 	if (idev) {
+#ifdef __ISAPNP__
 		irq = pnp_irq(idev, 0);
+#else
+		/* Can not happen - in the !PNP case we always pass in NULL */
+		BUG_ON(1);
+#endif
 		vp->dev = &idev->dev;
 	} else {
 		irq = inw(ioaddr + 0x2002) & 15;
#1 lore raw
Quoted 13 lines · On Fri, 20 Jun 2008 11:33:16 +0200 Ingo Molnar wrote:

commit 2538003ce2ea0b936d273692bc4e51c5b52fe70d

Author: Ingo Molnar <[email protected]>
Date:   Fri Jun 20 11:29:31 2008 +0200

fix 3c515.c:(.text+0x57200): undefined reference to `pnp_get_resource'

-tip testing found the following build failure:

drivers/built-in.o: In function `corkscrew_setup':
3c515.c:(.text+0x57200): undefined reference to `pnp_get_resource'

which happens if 3c515.c is build without CONFIG_PNP:

Quoted 8 lines

http://redhat.com/~mingo/misc/config-Fri_Jun_20_10_02_43_CEST_2008.bad

the reason is pnp_irq() use outside of its __ISAPNP__ section.

corkscrew_setup() always called with NULL in the !__ISAPNP__ case, but also check this condition to make sure.

Patch is in Jeff's tree.

Sometimes we need to have build patches merged sooner rather than later... :(

Quoted 8 lines
drivers/net/3c515.c +0 -0
index 105a8c7..09dd063 100644
@@ -573,7 +573,12 @@ static int corkscrew_setup(struct net_device *dev, int ioaddr,
 	DECLARE_MAC_BUF(mac);
 
 	if (idev) {

drivers/net/3c515.c static int corkscrew_setup(struct net_device *dev, int ioaddr,

Quoted 10 lines
drivers/net/3c515.c +5 -1
+#ifdef __ISAPNP__
 		irq = pnp_irq(idev, 0);
+#else
+		/* Can not happen - in the !PNP case we always pass in NULL */
+		BUG_ON(1);
+#endif
 		vp->dev = &idev->dev;
 	} else {
 		irq = inw(ioaddr + 0x2002) & 15;
--

---
~Randy
Linux Plumbers Conference, 17-19 September 2008, Portland, Oregon USA
http://linuxplumbersconf.org/

#2 lore raw
Quoted 3 lines · Randy Dunlap
Quoted 1 line

Patch is in Jeff's tree.

i see. Hm, as far as i can see the patch was not Cc:-ed to lkml hence i did not see that it exist and created a patch for it. Please Cc: lkml for any mainline fix you think other people might trigger.

also, here's some small nitpicking about your patch:

+#ifdef __ISAPNP__

        if (idev) {
                irq = pnp_irq(idev, 0);
                vp->dev = &idev->dev;
        } else {
                irq = inw(ioaddr + 0x2002) & 15;
        }

+#else
+ irq = inw(ioaddr + 0x2002) & 15;
+#endif

as you now unconditonally assume that idev is NULL in the !__ISAPNP__. Which is true currently but might not be with other changes (which is unlikely but still). It also duplicates code visually.

So i'd still slightly prefer my patch instead of yours which avoids the duplication and puts the assumption/constraint straight in there via a BUG_ON():

Quoted 11 lines

drivers/net/3c515.c static int corkscrew_setup(struct net_device *dev, int ioaddr,

Quoted 11 lines
drivers/net/3c515.c +5 -1
 	if (idev) {
+#ifdef __ISAPNP__
 		irq = pnp_irq(idev, 0);
+#else
+		/* Can not happen - in the !PNP case we always pass in NULL */
+		BUG_ON(1);
+#endif
 		vp->dev = &idev->dev;
 	} else {
 		irq = inw(ioaddr + 0x2002) & 15;
--

no strong feelings though - it's a nitpick and this code is obviously obsolete.

Ingo