@@ -55,15 +55,15 @@ do { \
exit(1); \
} while(0)
-/* #define PFLASH_DEBUG */
-#ifdef PFLASH_DEBUG
-#define DPRINTF(fmt, ...) \
-do { \
- fprintf(stderr, "PFLASH: " fmt , ## __VA_ARGS__); \
-} while (0)
-#else
-#define DPRINTF(fmt, ...) do { } while (0)
-#endif
+#ifndef PFLASH_DEBUG
+#define PFLASH_DEBUG 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (PFLASH_DEBUG) { \
+ fprintf(stderr, "PFLASH: " fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
#define CFI_PFLASH01(obj) OBJECT_CHECK(pflash_t, (obj), TYPE_CFI_PFLASH01)
@@ -46,14 +46,17 @@
#include "hw/sysbus.h"
//#define PFLASH_DEBUG
-#ifdef PFLASH_DEBUG
-#define DPRINTF(fmt, ...) \
-do { \
- fprintf(stderr, "PFLASH: " fmt , ## __VA_ARGS__); \
-} while (0)
-#else
-#define DPRINTF(fmt, ...) do { } while (0)
-#endif
+
+#ifndef PFLASH_DEBUG
+#define PFLASH_DEBUG 0
+#endif
+
+#define DPRINTF(fmt, ...) do { \
+ if (PFLASH_DEBUG) { \
+ fprintf(stderr, "PFLASH: " fmt, ## __VA_ARGS__); \
+ } \
+} while (0);
+
#define PFLASH_LAZY_ROMD_THRESHOLD 42