btrfs-progs: fix debugging macro checks

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>
This commit is contained in:
David Sterba 2017-09-23 20:44:02 +02:00
parent 5b2fbc6f4e
commit 8eccfa86c0
1 changed files with 3 additions and 3 deletions

View File

@ -17,19 +17,19 @@
#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