[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 6/8] i.MX: Standardize i.MX FEC debug
From: |
Jean-Christophe Dubois |
Subject: |
[Qemu-devel] [PATCH 6/8] i.MX: Standardize i.MX FEC debug |
Date: |
Tue, 20 Oct 2015 23:20:05 +0200 |
The goal is to have debug code always compiled during build.
Signed-off-by: Jean-Christophe Dubois <address@hidden>
---
hw/net/imx_fec.c | 38 ++++++++++++++++++--------------------
1 file changed, 18 insertions(+), 20 deletions(-)
diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c
index 725f3fa..b39fc8d 100644
--- a/hw/net/imx_fec.c
+++ b/hw/net/imx_fec.c
@@ -27,31 +27,29 @@
/* For crc32 */
#include <zlib.h>
-#ifndef IMX_FEC_DEBUG
-#define IMX_FEC_DEBUG 0
+#ifndef DEBUG_IMX_FEC
+#define DEBUG_IMX_FEC 0
#endif
-#ifndef IMX_PHY_DEBUG
-#define IMX_PHY_DEBUG 0
-#endif
+#define FEC_PRINTF(fmt, args...) \
+ do { \
+ if (DEBUG_IMX_FEC) { \
+ fprintf(stderr, "[%s]%s: " fmt , TYPE_IMX_FEC, \
+ __func__, ##args); \
+ } \
+ } while (0)
-#if IMX_FEC_DEBUG
-#define FEC_PRINTF(fmt, ...) \
- do { fprintf(stderr, "%s[%s]: " fmt , TYPE_IMX_FEC, __func__, \
- ## __VA_ARGS__); \
- } while (0)
-#else
-#define FEC_PRINTF(fmt, ...) do {} while (0)
+#ifndef DEBUG_IMX_PHY
+#define DEBUG_IMX_PHY 0
#endif
-#if IMX_PHY_DEBUG
-#define PHY_PRINTF(fmt, ...) \
- do { fprintf(stderr, "%s.phy[%s]: " fmt , TYPE_IMX_FEC, __func__, \
- ## __VA_ARGS__); \
- } while (0)
-#else
-#define PHY_PRINTF(fmt, ...) do {} while (0)
-#endif
+#define PHY_PRINTF(fmt, args...) \
+ do { \
+ if (DEBUG_IMX_PHY) { \
+ fprintf(stderr, "[%s.phy]%s: " fmt , TYPE_IMX_FEC, \
+ __func__, ##args); \
+ } \
+ } while (0)
static const VMStateDescription vmstate_imx_fec = {
.name = TYPE_IMX_FEC,
--
2.1.4
- Re: [Qemu-devel] [PATCH 1/8] i.MX: Standardize i.MX serial debug., (continued)
- [Qemu-devel] [PATCH 2/8] i.MX: Standardize i.MX GPIO debug, Jean-Christophe Dubois, 2015/10/20
- [Qemu-devel] [PATCH 3/8] i.MX: Standardize i.MX I2C debug, Jean-Christophe Dubois, 2015/10/20
- [Qemu-devel] [PATCH 4/8] i.MX: Standardize i.MX AVIC debug, Jean-Christophe Dubois, 2015/10/20
- [Qemu-devel] [PATCH 5/8] i.MX: Standardize i.MX CCM debug, Jean-Christophe Dubois, 2015/10/20
- [Qemu-devel] [PATCH 7/8] i.MX: Standardize i.MX EPIT debug, Jean-Christophe Dubois, 2015/10/20
- [Qemu-devel] [PATCH 8/8] i.MX: Standardize i.MX GPT debug, Jean-Christophe Dubois, 2015/10/20
- [Qemu-devel] [PATCH 6/8] i.MX: Standardize i.MX FEC debug,
Jean-Christophe Dubois <=
- Re: [Qemu-devel] [PATCH 0/8] i.MX: Standardize debug code, Peter Crosthwaite, 2015/10/20