diff mbox

[V4,2/2] sdhci: Change debug prints to compile unconditionally

Message ID 1441649201-13839-2-git-send-email-saipava@xilinx.com
State New
Headers show

Commit Message

Sai Pavan Boddu Sept. 7, 2015, 6:06 p.m. UTC
Conditional compilation hides few type mismatch warnings, fix it to
compile unconditionally.

Signed-off-by: Sai Pavan Boddu <saipava@xilinx.com>
Suggested-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
---
Changes for V4:
    fix the commit message mistakes.
---
 hw/sd/sdhci.c | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

Comments

Michael Tokarev Sept. 16, 2015, 10:26 a.m. UTC | #1
07.09.2015 21:06, Sai Pavan Boddu wrote:
> Conditional compilation hides few type mismatch warnings, fix it to
> compile unconditionally.

Applied to the trivial-patches tree, thanks!

/mjt
Sai Pavan Boddu Sept. 16, 2015, 10:56 a.m. UTC | #2
> -----Original Message-----
> From: Michael Tokarev [mailto:mjt@tls.msk.ru]
> Sent: Wednesday, September 16, 2015 3:56 PM
> To: Sai Pavan Boddu; qemu-devel@nongnu.org;
> crosthwaitepeter@gmail.com; eblake@redhat.com;
> peter.maydell@linaro.org
> Cc: Sai Pavan Boddu; Edgar Iglesias; Alistair Francis; qemu-trivial
> Subject: Re: [PATCH V4 2/2] sdhci: Change debug prints to compile
> unconditionally
> 
> 07.09.2015 21:06, Sai Pavan Boddu wrote:
> > Conditional compilation hides few type mismatch warnings, fix it to
> > compile unconditionally.
> 
> Applied to the trivial-patches tree, thanks!
Thanks Michael,

Regards,
Sai
> 
> /mjt
diff mbox

Patch

diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
index e6348ef..4c0ddf6 100644
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -37,24 +37,24 @@ 
 #define SDHC_DEBUG                        0
 #endif
 
-#if SDHC_DEBUG == 0
-    #define DPRINT_L1(fmt, args...)       do { } while (0)
-    #define DPRINT_L2(fmt, args...)       do { } while (0)
-    #define ERRPRINT(fmt, args...)        do { } while (0)
-#elif SDHC_DEBUG == 1
-    #define DPRINT_L1(fmt, args...)       \
-        do {fprintf(stderr, "QEMU SDHC: "fmt, ## args); } while (0)
-    #define DPRINT_L2(fmt, args...)       do { } while (0)
-    #define ERRPRINT(fmt, args...)        \
-        do {fprintf(stderr, "QEMU SDHC ERROR: "fmt, ## args); } while (0)
-#else
-    #define DPRINT_L1(fmt, args...)       \
-        do {fprintf(stderr, "QEMU SDHC: "fmt, ## args); } while (0)
-    #define DPRINT_L2(fmt, args...)       \
-        do {fprintf(stderr, "QEMU SDHC: "fmt, ## args); } while (0)
-    #define ERRPRINT(fmt, args...)        \
-        do {fprintf(stderr, "QEMU SDHC ERROR: "fmt, ## args); } while (0)
-#endif
+#define DPRINT_L1(fmt, args...) \
+    do { \
+        if (SDHC_DEBUG) { \
+            fprintf(stderr, "QEMU SDHC: " fmt, ## args); \
+        } \
+    } while (0)
+#define DPRINT_L2(fmt, args...) \
+    do { \
+        if (SDHC_DEBUG > 1) { \
+            fprintf(stderr, "QEMU SDHC: " fmt, ## args); \
+        } \
+    } while (0)
+#define ERRPRINT(fmt, args...) \
+    do { \
+        if (SDHC_DEBUG) { \
+            fprintf(stderr, "QEMU SDHC ERROR: " fmt, ## args); \
+        } \
+    } while (0)
 
 /* Default SD/MMC host controller features information, which will be
  * presented in CAPABILITIES register of generic SD host controller at reset.