Skip to contentSkip to conversation

Cleanup usage of DEBUG name

PATCH New Riccardo Magliocchetti 1 participant 4 messages May 19, 2010

lore
Share & tools
lore
#0 lore raw

cover Cleanup usage of DEBUG name

Some files use DEBUG as a preprocessor conditionals to enable debug code and i find handy to pass -DDEBUG as extra cflags at configure time.
Unfortunately this cannot be done if DEBUG name is used for other purposes.

Riccardo Magliocchetti (3):
Rename DEBUG field to TC_DEBUG to avoid name clashes Rename DEBUG macro to MSIX_LOG to avoid name clashes Rename DEBUG define to E1000_DEBUG to avoid name clashes

 hw/e1000.c    |    4 ++--
 hw/msix.c     |    4 ++--
 hw/tc6393xb.c |    8 ++++----
 3 files changed, 8 insertions(+), 8 deletions(-)
#1 lore raw

PATCH 1/3 Rename DEBUG field to TC_DEBUG to avoid name clashes

Some files use DEBUG as a preprocessor conditionals to enable debug code and i find handy to pass -DDEBUG as extra cflags at configure time.
Unfortunately this cannot be done if DEBUG name is used for other purposes.

---
 hw/tc6393xb.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
hw/tc6393xb.c +4 -4
index e0c5e5f..31a5fa1 100644
@@ -49,7 +49,7 @@
 #define SCR_FER		0xe0		/* b Function Enable	*/
 #define SCR_MCR		0xe4		/* w Mode Control	*/
 #define SCR_CONFIG	0xfc		/* b Configuration Control */
-#define SCR_DEBUG	0xff		/* b Debug		*/
+#define SCR_TC_DEBUG	0xff		/* b Debug		*/
 
 #define NAND_CFG_COMMAND    0x04    /* w Command        */
 #define NAND_CFG_BASE       0x10    /* l Control Base Address */
@@ -103,7 +103,7 @@ struct TC6393xbState {
         uint8_t FER;
         uint16_t MCR;
         uint8_t CONFIG;
-        uint8_t DEBUG;
+        uint8_t TC_DEBUG;
     } scr;
     uint32_t gpio_dir;
     uint32_t gpio_level;
@@ -247,7 +247,7 @@ static uint32_t tc6393xb_scr_readb(TC6393xbState *s, target_phys_addr_t addr)
         SCR_REG_B(FER);
         SCR_REG_W(MCR);
         SCR_REG_B(CONFIG);
-        SCR_REG_B(DEBUG);
+        SCR_REG_B(TC_DEBUG);
     }
     fprintf(stderr, "tc6393xb_scr: unhandled read at %08x\n", (uint32_t) addr);
     return 0;
@@ -308,7 +308,7 @@ static void tc6393xb_scr_writeb(TC6393xbState *s, target_phys_addr_t addr, uint3
         SCR_REG_B(FER);
         SCR_REG_W(MCR);
         SCR_REG_B(CONFIG);
-        SCR_REG_B(DEBUG);
+        SCR_REG_B(TC_DEBUG);
     }
     fprintf(stderr, "tc6393xb_scr: unhandled write at %08x: %02x\n",
 					(uint32_t) addr, value & 0xff);
Signature · 1 line
1.7.1
#2 lore raw

PATCH 2/3 Rename DEBUG macro to MSIX_LOG to avoid name clashes

In reply to Riccardo Magliocchetti

Some files use DEBUG as a preprocessor conditionals to enable debug code and i find handy to pass -DDEBUG as extra cflags at configure time.
Unfortunately this cannot be done if DEBUG name is used for other purposes.

---
 hw/msix.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
hw/msix.c +2 -2
index 2ca0900..36ef098 100644
@@ -51,12 +51,12 @@
 
 
 #ifdef MSIX_DEBUG
-#define DEBUG(fmt, ...)                                       \
+#define MSIX_LOG(fmt, ...)                                    \
     do {                                                      \
       fprintf(stderr, "%s: " fmt, __func__ , __VA_ARGS__);    \
     } while (0)
 #else
-#define DEBUG(fmt, ...) do { } while(0)
+#define MSIX_LOG(fmt, ...) do { } while(0)
 #endif
 
 /* Flag for interrupt controller to declare MSI-X support */
Signature · 1 line
1.7.1
#3 lore raw

PATCH 3/3 Rename DEBUG define to E1000_DEBUG to avoid name clashes

In reply to Riccardo Magliocchetti

Some files use DEBUG as a preprocessor conditionals to enable debug code and i find handy to pass -DDEBUG as extra cflags at configure time.
Unfortunately this cannot be done if DEBUG name is used for other purposes.

---
 hw/e1000.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
hw/e1000.c +2 -2
index 96d045d..0da65f9 100644
@@ -33,9 +33,9 @@
 
 #include "e1000_hw.h"
 
-#define DEBUG
+#define E1000_DEBUG
 
-#ifdef DEBUG
+#ifdef E1000_DEBUG
 enum {
     DEBUG_GENERAL,	DEBUG_IO,	DEBUG_MMIO,	DEBUG_INTERRUPT,
     DEBUG_RX,		DEBUG_TX,	DEBUG_MDIC,	DEBUG_EEPROM,
Signature · 1 line
1.7.1