btrfs-progs: fix debugging macro checks
authorDavid Sterba <dsterba@suse.com>
Sat, 23 Sep 2017 18:44:02 +0000 (20:44 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Sep 2017 13:18:17 +0000 (15:18 +0200)
Sparse warns that the DEBUG_*_ERROR macros are not defined when checked.
Use the ifdef check rather then relying on the implicit behaviour.

Signed-off-by: David Sterba <dsterba@suse.com>
messages.h

index a308b4b..4999c7b 100644 (file)
 #ifndef __BTRFS_MESSAGES_H__
 #define __BTRFS_MESSAGES_H__
 
-#if DEBUG_VERBOSE_ERROR
+#ifdef DEBUG_VERBOSE_ERROR
 #define        PRINT_VERBOSE_ERROR     fprintf(stderr, "%s:%d:", __FILE__, __LINE__)
 #else
 #define PRINT_VERBOSE_ERROR
 #endif
 
-#if DEBUG_TRACE_ON_ERROR
+#ifdef DEBUG_TRACE_ON_ERROR
 #define PRINT_TRACE_ON_ERROR   print_trace()
 #else
 #define PRINT_TRACE_ON_ERROR
 #endif
 
-#if DEBUG_ABORT_ON_ERROR
+#ifdef DEBUG_ABORT_ON_ERROR
 #define DO_ABORT_ON_ERROR      abort()
 #else
 #define DO_ABORT_ON_ERROR