Patchwork [U-Boot,01/22] drivers/net/pcnet.c: Change debug code to fix build warning

login
register
mail settings
Submitter Wolfgang Denk
Date Nov. 5, 2011, 3:12 p.m.
Message ID <1320505999-9770-2-git-send-email-wd@denx.de>
Download mbox | patch
Permalink /patch/123860/
State Accepted
Commit 138b60895dff0e03301937901aee3d57ca2a067c
Headers show

Comments

Wolfgang Denk - Nov. 5, 2011, 3:12 p.m.
Fix:
pcnet.c: In function 'pcnet_probe':
pcnet.c:247:8: warning: variable 'chipname' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Wolfgang Grandegger <wg@denx.de>
---
 drivers/net/pcnet.c |   17 ++++-------------
 1 files changed, 4 insertions(+), 13 deletions(-)
Wolfgang Denk - Nov. 7, 2011, 9:18 p.m.
Dear Wolfgang Denk,

In message <1320505999-9770-2-git-send-email-wd@denx.de> you wrote:
> Fix:
> pcnet.c: In function 'pcnet_probe':
> pcnet.c:247:8: warning: variable 'chipname' set but not used
> [-Wunused-but-set-variable]
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> Cc: Wolfgang Grandegger <wg@denx.de>
> ---
>  drivers/net/pcnet.c |   17 ++++-------------
>  1 files changed, 4 insertions(+), 13 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/drivers/net/pcnet.c b/drivers/net/pcnet.c
index e994cb6..45066c8 100644
--- a/drivers/net/pcnet.c
+++ b/drivers/net/pcnet.c
@@ -30,21 +30,12 @@ 
 #include <asm/io.h>
 #include <pci.h>
 
-#if 0
 #define	PCNET_DEBUG_LEVEL	0	/* 0=off, 1=init, 2=rx/tx */
-#endif
 
-#if PCNET_DEBUG_LEVEL > 0
-#define	PCNET_DEBUG1(fmt,args...)	printf (fmt ,##args)
-#if PCNET_DEBUG_LEVEL > 1
-#define	PCNET_DEBUG2(fmt,args...)	printf (fmt ,##args)
-#else
-#define PCNET_DEBUG2(fmt,args...)
-#endif
-#else
-#define PCNET_DEBUG1(fmt,args...)
-#define PCNET_DEBUG2(fmt,args...)
-#endif
+#define PCNET_DEBUG1(fmt,args...)	\
+	debug_cond(PCNET_DEBUG_LEVEL > 0, fmt ,##args)
+#define PCNET_DEBUG2(fmt,args...)	\
+	debug_cond(PCNET_DEBUG_LEVEL > 1, fmt ,##args)
 
 #if !defined(CONF_PCNET_79C973) && defined(CONF_PCNET_79C975)
 #error "Macro for PCnet chip version is not defined!"