Skip to contentSkip to conversation

drivers/net/ne2000_base.c: Fix GCC 4.6 build warnings

PATCH New Wolfgang Denk 1 participant 2 messages Dec 8, 2011 – Dec 10, 2011 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/net/ne2000_base.c: Fix GCC 4.6 build warnings

Fix:
ne2000_base.c: In function 'dp83902a_send':
ne2000_base.c:282:7: warning: variable 'tmp' set but not used [-Wunused-but-set-variable]
ne2000_base.c: In function 'dp83902a_RxEvent':
ne2000_base.c:376:5: warning: variable 'rsr' set but not used [-Wunused-but-set-variable]
ne2000_base.c: In function 'dp83902a_TxEvent':
ne2000_base.c:513:5: warning: variable 'tsr' set but not used [-Wunused-but-set-variable]
ne2000_base.c: In function 'dp83902a_ClearCounters':
ne2000_base.c:550:17: warning: variable 'cnt3' set but not used [-Wunused-but-set-variable]
ne2000_base.c:550:11: warning: variable 'cnt2' set but not used [-Wunused-but-set-variable]
ne2000_base.c:550:5: warning: variable 'cnt1' set but not used [-Wunused-but-set-variable]

---
 drivers/net/ne2000_base.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
drivers/net/ne2000_base.c +5 -4
index 88f2b37..8275091 100644
@@ -76,6 +76,7 @@ Add SNMP
 #include <command.h>
 #include <net.h>
 #include <malloc.h>
+#include <linux/compiler.h>
 
 /* forward definition of function used for the uboot interface */
 void uboot_push_packet_len(int len);
@@ -279,7 +280,7 @@ dp83902a_send(u8 *data, int total_len, u32 key)
 		 * does (i.e., also read data).
 		 */
 
-		u16 tmp;
+		__maybe_unused u16 tmp;
 		int len = 1;
 
 		DP_OUT(base, DP_RSAL, 0x100 - len);
@@ -373,7 +374,7 @@ dp83902a_RxEvent(void)
 {
 	struct dp83902a_priv_data *dp = (struct dp83902a_priv_data *) &nic;
 	u8 *base = dp->base;
-	u8 rsr;
+	__maybe_unused u8 rsr;
 	u8 rcv_hdr[4];
 	int i, len, pkt, cur;
 
@@ -510,7 +511,7 @@ dp83902a_TxEvent(void)
 {
 	struct dp83902a_priv_data *dp = (struct dp83902a_priv_data *) &nic;
 	u8 *base = dp->base;
-	u8 tsr;
+	__maybe_unused u8 tsr;
 	u32 key;
 
 	DEBUG_FUNCTION();
@@ -547,7 +548,7 @@ dp83902a_ClearCounters(void)
 {
 	struct dp83902a_priv_data *dp = (struct dp83902a_priv_data *) &nic;
 	u8 *base = dp->base;
-	u8 cnt1, cnt2, cnt3;
+	__maybe_unused u8 cnt1, cnt2, cnt3;
 
 	DP_IN(base, DP_FER, cnt1);
 	DP_IN(base, DP_CER, cnt2);
Signature · 1 line
1.7.6.4
author Applied
#1 lore raw

PATCH 1/1 drivers/net/ne2000_base.c: Fix GCC 4.6 build warnings

Dear Wolfgang Denk,

Quoted 18 lines · In message <[email protected]> you wrote:

Fix:
ne2000_base.c: In function 'dp83902a_send':
ne2000_base.c:282:7: warning: variable 'tmp' set but not used [-Wunused-but-set-variable]
ne2000_base.c: In function 'dp83902a_RxEvent':
ne2000_base.c:376:5: warning: variable 'rsr' set but not used [-Wunused-but-set-variable]
ne2000_base.c: In function 'dp83902a_TxEvent':
ne2000_base.c:513:5: warning: variable 'tsr' set but not used [-Wunused-but-set-variable]
ne2000_base.c: In function 'dp83902a_ClearCounters':
ne2000_base.c:550:17: warning: variable 'cnt3' set but not used [-Wunused-but-set-variable]
ne2000_base.c:550:11: warning: variable 'cnt2' set but not used [-Wunused-but-set-variable]
ne2000_base.c:550:5: warning: variable 'cnt1' set but not used [-Wunused-but-set-variable]

Quoted 4 lines
---
 drivers/net/ne2000_base.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If some day we are defeated, well, war has  its  fortunes,  good  and
bad.
	-- Commander Kor, "Errand of Mercy", stardate 3201.7