Patchwork [v1,2/4] pflash_cfi0x: Send debug messages to stderr

login
register
mail settings
Submitter Peter Crosthwaite
Date Dec. 4, 2012, 6:04 a.m.
Message ID <1406c119ace82fb9e443122c8a99ae278bd373dc.1354600680.git.peter.crosthwaite@xilinx.com>
Download mbox | patch
Permalink /patch/203567/
State New
Headers show

Comments

Peter Crosthwaite - Dec. 4, 2012, 6:04 a.m.
These debug info messages should go to stderr rather than stdout.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
---

 hw/pflash_cfi01.c |    8 ++++----
 hw/pflash_cfi02.c |    6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)
Peter Maydell - Dec. 4, 2012, 6:19 p.m.
On 4 December 2012 06:04, Peter Crosthwaite
<peter.crosthwaite@xilinx.com> wrote:
> 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>

-- PMM

Patch

diff --git a/hw/pflash_cfi01.c b/hw/pflash_cfi01.c
index f9f8e5d..931264f 100644
--- a/hw/pflash_cfi01.c
+++ b/hw/pflash_cfi01.c
@@ -46,15 +46,15 @@ 
 
 #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)
diff --git a/hw/pflash_cfi02.c b/hw/pflash_cfi02.c
index f918e36..c60ae83 100644
--- a/hw/pflash_cfi02.c
+++ b/hw/pflash_cfi02.c
@@ -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)