pflash_cfi0x: Send debug messages to stderr
authorPeter Crosthwaite <peter.crosthwaite@xilinx.com>
Tue, 4 Dec 2012 06:04:34 +0000 (16:04 +1000)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 18 Dec 2012 15:49:51 +0000 (16:49 +0100)
These debug info messages should go to stderr rather than stdout.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/pflash_cfi01.c
hw/pflash_cfi02.c

index f9f8e5d03c359315f0391fa944ae3c0acebce779..931264ff8c3019d2aa5bb7dc618bfbac2de7c1a1 100644 (file)
 
 #define PFLASH_BUG(fmt, ...) \
 do { \
-    printf("PFLASH: Possible BUG - " fmt, ## __VA_ARGS__); \
+    fprintf(stderr, "PFLASH: Possible BUG - " fmt, ## __VA_ARGS__); \
     exit(1); \
 } while(0)
 
 /* #define PFLASH_DEBUG */
 #ifdef PFLASH_DEBUG
-#define DPRINTF(fmt, ...)                          \
-do {                                               \
-    printf("PFLASH: " fmt , ## __VA_ARGS__);       \
+#define DPRINTF(fmt, ...)                                   \
+do {                                                        \
+    fprintf(stderr, "PFLASH: " fmt , ## __VA_ARGS__);       \
 } while (0)
 #else
 #define DPRINTF(fmt, ...) do { } while (0)
index f918e36580f43865c4844278fc31faef103b82ae..c60ae831b4b3058618dd4c34018a8ec4189ee73f 100644 (file)
@@ -45,9 +45,9 @@
 
 //#define PFLASH_DEBUG
 #ifdef PFLASH_DEBUG
-#define DPRINTF(fmt, ...)                          \
-do {                                               \
-    printf("PFLASH: " fmt , ## __VA_ARGS__);       \
+#define DPRINTF(fmt, ...)                                  \
+do {                                                       \
+    fprintf(stderr "PFLASH: " fmt , ## __VA_ARGS__);       \
 } while (0)
 #else
 #define DPRINTF(fmt, ...) do { } while (0)