Signed-off-by: Mike Frysinger <[email protected]>
---
drivers/net/smc91x.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
index c70870e..6f9895d 100644
--- a/drivers/net/smc91x.c
+++ b/drivers/net/smc91x.c
@@ -2060,7 +2060,6 @@ 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 = netdev_priv(ndev);
if (!res)
return 0;
@@ -2075,7 +2074,6 @@ 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 = netdev_priv(ndev);
if (res)
release_mem_region(res->start, ATTRIB_SIZE);
--
1.6.0.2
On Wed, 29 Oct 2008, Mike Frysinger wrote:
> Signed-off-by: Mike Frysinger <[email protected]>
Acked-by: Nicolas Pitre <[email protected]>
> ---
> drivers/net/smc91x.c | 2 --
> 1 files changed, 0 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
> index c70870e..6f9895d 100644
> --- a/drivers/net/smc91x.c
> +++ b/drivers/net/smc91x.c
> @@ -2060,7 +2060,6 @@ 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 = netdev_priv(ndev);
>
> if (!res)
> return 0;
> @@ -2075,7 +2074,6 @@ 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 = netdev_priv(ndev);
>
> if (res)
> release_mem_region(res->start, ATTRIB_SIZE);
> --
> 1.6.0.2
>
Nicolas
Mike Frysinger wrote:
> Signed-off-by: Mike Frysinger <[email protected]>
> ---
> drivers/net/smc91x.c | 2 --
> 1 files changed, 0 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
> index c70870e..6f9895d 100644
> --- a/drivers/net/smc91x.c
> +++ b/drivers/net/smc91x.c
> @@ -2060,7 +2060,6 @@ 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 = netdev_priv(ndev);
>
> if (!res)
> return 0;
> @@ -2075,7 +2074,6 @@ 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 = netdev_priv(ndev);
>
applied
On Wed, 29 Oct 2008 09:56:06 -0400, Mike Frysinger <[email protected]> wrote:
> Signed-off-by: Mike Frysinger <[email protected]>
> ---
> drivers/net/smc91x.c | 2 --
> 1 files changed, 0 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
> index c70870e..6f9895d 100644
> --- a/drivers/net/smc91x.c
> +++ b/drivers/net/smc91x.c
> @@ -2060,7 +2060,6 @@ 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 = netdev_priv(ndev);
>
> if (!res)
> return 0;
The local variable 'lp' is actually used on some platforms (via
SMC_IO_SHIFT).
Please revert this change and do another way ("unused" marker or
something) to fix the warnings.
---
Atsushi Nemoto
On Tue, 4 Nov 2008, Atsushi Nemoto wrote:
> On Wed, 29 Oct 2008 09:56:06 -0400, Mike Frysinger <[email protected]> wrote:
> > Signed-off-by: Mike Frysinger <[email protected]>
> > ---
> > drivers/net/smc91x.c | 2 --
> > 1 files changed, 0 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
> > index c70870e..6f9895d 100644
> > --- a/drivers/net/smc91x.c
> > +++ b/drivers/net/smc91x.c
> > @@ -2060,7 +2060,6 @@ 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 = netdev_priv(ndev);
> >
> > if (!res)
> > return 0;
>
> The local variable 'lp' is actually used on some platforms (via
> SMC_IO_SHIFT).
Oops, indeed.
> Please revert this change and do another way ("unused" marker or
> something) to fix the warnings.
There were no warnings AFAIK.
Actually, the best fix might be the following patch:
-----
From: Nicolas Pitre <[email protected]>
Commit 51ac3beffd removed an apparently unused local variable from
smc_request_attrib(), but some platforms actually needs the lp variable
to define SMC_IO_SHIFT which is used to define ATTRIB_SIZE.
Let's always add a reference to lp to avoid such mistakes in the future,
which in the constant case gets optimized away at compile time.
Signed-off-by: Nicolas Pitre <[email protected]>
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
index 6f9895d..a657321 100644
--- a/drivers/net/smc91x.c
+++ b/drivers/net/smc91x.c
@@ -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 = netdev_priv(ndev);
if (!res)
return 0;
diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h
index a07cc93..23fc21a 100644
--- a/drivers/net/smc91x.h
+++ b/drivers/net/smc91x.h
@@ -91,7 +91,6 @@ static inline void SMC_outw(u16 val, void __iomem *ioaddr, int reg)
#define SMC_CAN_USE_8BIT 0
#define SMC_CAN_USE_16BIT 1
#define SMC_CAN_USE_32BIT 1
-#define SMC_IO_SHIFT 0
#define SMC_NOWAIT 1
#define SMC_USE_BFIN_DMA 0
@@ -106,7 +105,6 @@ static inline void SMC_outw(u16 val, void __iomem *ioaddr, int reg)
#define SMC_CAN_USE_8BIT 0
#define SMC_CAN_USE_16BIT 1
#define SMC_CAN_USE_32BIT 0
-#define SMC_IO_SHIFT 0
#define SMC_NOWAIT 1
#define SMC_USE_BFIN_DMA 0
@@ -138,7 +136,6 @@ static inline void SMC_outw(u16 val, void __iomem *ioaddr, int reg)
#define SMC_CAN_USE_32BIT 0
#define SMC_NOWAIT 1
-#define SMC_IO_SHIFT 0
#define SMC_inw(a, r) in_be16((volatile u16 *)((a) + (r)))
#define SMC_outw(v, a, r) out_be16((volatile u16 *)((a) + (r)), v)
@@ -172,7 +169,6 @@ static inline void SMC_outw(u16 val, void __iomem *ioaddr, int reg)
#define SMC_CAN_USE_8BIT 1
#define SMC_CAN_USE_16BIT 1
#define SMC_CAN_USE_32BIT 0
-#define SMC_IO_SHIFT 0
#define SMC_NOWAIT 1
#define SMC_inb(a, r) readb((a) + (r))
@@ -197,7 +193,7 @@ static inline void SMC_outw(u16 val, void __iomem *ioaddr, int reg)
#define SMC_NOWAIT 1
/* The first two address lines aren't connected... */
-#define SMC_IO_SHIFT 2
+#define SMC_IO_SHIFT (lp, 2)
#define SMC_inb(a, r) readb((a) + (r))
#define SMC_outb(v, a, r) writeb(v, (a) + (r))
@@ -210,7 +206,6 @@ static inline void SMC_outw(u16 val, void __iomem *ioaddr, int reg)
#define SMC_CAN_USE_8BIT 0
#define SMC_CAN_USE_16BIT 1
#define SMC_CAN_USE_32BIT 0
-#define SMC_IO_SHIFT 0
#define SMC_NOWAIT 1
#define SMC_inw(a, r) readw((a) + (r))
@@ -226,7 +221,6 @@ static inline void SMC_outw(u16 val, void __iomem *ioaddr, int reg)
#define SMC_CAN_USE_8BIT 1
#define SMC_CAN_USE_16BIT 1
#define SMC_CAN_USE_32BIT 1
-#define SMC_IO_SHIFT 0
#define SMC_NOWAIT 1
#define SMC_USE_PXA_DMA 1
@@ -258,7 +252,6 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg)
#define SMC_CAN_USE_8BIT 0
#define SMC_CAN_USE_16BIT 1
#define SMC_CAN_USE_32BIT 0
-#define SMC_IO_SHIFT 0
#define SMC_NOWAIT 1
#define SMC_inw(a, r) readw((a) + (r))
@@ -387,7 +380,6 @@ static inline void LPD7_SMC_outsw (unsigned char* a, int r,
#define SMC_CAN_USE_8BIT 0
#define SMC_CAN_USE_16BIT 1
#define SMC_CAN_USE_32BIT 0
-#define SMC_IO_SHIFT 0
#define SMC_NOWAIT 1
#define SMC_inw(a, r) au_readw((unsigned long)((a) + (r)))
@@ -682,7 +674,7 @@ smc_pxa_dma_irq(int dma, void *dummy)
#endif
#ifndef SMC_IO_SHIFT
-#define SMC_IO_SHIFT 0
+#define SMC_IO_SHIFT (lp, 0)
#endif
#ifndef SMC_IRQ_FLAGS
you need to revert both functions. David Miller has already posted a
patch which adds warning markers instead.
-mike