SMC91x: Fix compilation on some platforms.
authorDavid S. Miller <davem@davemloft.net>
Mon, 3 Nov 2008 08:04:24 +0000 (00:04 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Nov 2008 08:19:31 +0000 (00:19 -0800)
This reverts 51ac3beffd4afaea4350526cf01fe74aaff25eff ('SMC91x: delete
unused local variable "lp"') and adds __maybe_unused markers to these
(potentially) unused variables.

The issue is that in some configurations SMC_IO_SHIFT evaluates
to '(lp->io_shift)', but in some others it's plain '0'.

Based upon a build failure report from Manuel Lauss.

Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/smc91x.c

index 6f9895d4e5bdf3016b5930d8b6716a81bf714ed7..fc80f250da31e8940bcc2d89d781de5eca66d7f2 100644 (file)
@@ -2060,6 +2060,7 @@ static int smc_request_attrib(struct platform_device *pdev,
                              struct net_device *ndev)
 {
        struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-attrib");
+       struct smc_local *lp __maybe_unused = netdev_priv(ndev);
 
        if (!res)
                return 0;
@@ -2074,6 +2075,7 @@ static void smc_release_attrib(struct platform_device *pdev,
                               struct net_device *ndev)
 {
        struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-attrib");
+       struct smc_local *lp __maybe_unused = netdev_priv(ndev);
 
        if (res)
                release_mem_region(res->start, ATTRIB_SIZE);