Patchwork [U-Boot,04/10] drivers/net/lan91c96.c: Fix GCC 4.6 warning

login
register
mail settings
Submitter Anatolij Gustschin
Date Nov. 19, 2011, 11:12 p.m.
Message ID <1321744338-13207-5-git-send-email-agust@denx.de>
Download mbox | patch
Permalink /patch/126626/
State Accepted
Commit dffc0ae86d2ec1edb26319a3c1ace57e819c0312
Headers show

Comments

Anatolij Gustschin - Nov. 19, 2011, 11:12 p.m.
Fix:
lan91c96.c: In function 'dump_memory_info':
lan91c96.c:157:7: warning: variable 'mem_info' set but not used
[-Wunused-but-set-variable]
lan91c96.c: In function 'smc_send_packet':
lan91c96.c:320:16: warning: variable 'ioaddr' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
 drivers/net/lan91c96.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
Heiko Schocher - Nov. 23, 2011, 7:21 a.m.
Hello Anatolij,

Anatolij Gustschin wrote:
> Fix:
> lan91c96.c: In function 'dump_memory_info':
> lan91c96.c:157:7: warning: variable 'mem_info' set but not used
> [-Wunused-but-set-variable]
> lan91c96.c: In function 'smc_send_packet':
> lan91c96.c:320:16: warning: variable 'ioaddr' set but not used
> [-Wunused-but-set-variable]
> 
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> ---
>  drivers/net/lan91c96.c |    7 ++-----
>  1 files changed, 2 insertions(+), 5 deletions(-)

Applied to u-boot-staging hs@denx.de

Thanks!

bye,
Heiko

Patch

diff --git a/drivers/net/lan91c96.c b/drivers/net/lan91c96.c
index 883f3a7..24b28da 100644
--- a/drivers/net/lan91c96.c
+++ b/drivers/net/lan91c96.c
@@ -63,6 +63,7 @@ 
 #include <malloc.h>
 #include "lan91c96.h"
 #include <net.h>
+#include <linux/compiler.h>
 
 /*------------------------------------------------------------------------
  *
@@ -154,7 +155,7 @@  static void smc_set_mac_addr(const unsigned char *addr)
  ***********************************************/
 void dump_memory_info(struct eth_device *dev)
 {
-	word mem_info;
+	__maybe_unused word mem_info;
 	word old_bank;
 
 	old_bank = SMC_inw(dev, LAN91C96_BANK_SELECT) & 0xF;
@@ -317,7 +318,6 @@  static int smc_send_packet(struct eth_device *dev, volatile void *packet,
 		int packet_length)
 {
 	byte packet_no;
-	unsigned long ioaddr;
 	byte *buf;
 	int length;
 	int numPages;
@@ -381,9 +381,6 @@  static int smc_send_packet(struct eth_device *dev, volatile void *packet,
 			 dev->name, try);
 
 	/* I can send the packet now.. */
-
-	ioaddr = dev->iobase;
-
 	buf = (byte *) packet;
 
 	/* If I get here, I _know_ there is a packet slot waiting for me */