From: Qu Wenruo Date: Thu, 6 Oct 2016 08:47:19 +0000 (+0800) Subject: btrfs-progs: Fix warning_trace compile error if backtrace is disabled X-Git-Tag: upstream/4.16.1~1203 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bb5bcb8a4a2792eb9aa4683be58da1a030786198;p=platform%2Fupstream%2Fbtrfs-progs.git btrfs-progs: Fix warning_trace compile error if backtrace is disabled If we disable backtrace, btrfs-progs can't be compiled since we don't have warning_trace defined. Fix by move it out of #ifndef BTRFS_DISABLE_BACKTRACE block. Signed-off-by: Qu Wenruo [ move warning_trace to the right place ] Signed-off-by: David Sterba --- diff --git a/kerncompat.h b/kerncompat.h index ea04ef3..4a8f813 100644 --- a/kerncompat.h +++ b/kerncompat.h @@ -99,6 +99,11 @@ static inline void assert_trace(const char *assertion, const char *filename, exit(1); } +#define BUG() assert_trace(NULL, __FILE__, __func__, __LINE__, 0) +#else +#define BUG() assert(0) +#endif + static inline void warning_trace(const char *assertion, const char *filename, const char *func, unsigned line, int val, int trace) @@ -113,14 +118,12 @@ static inline void warning_trace(const char *assertion, const char *filename, fprintf(stderr, "%s:%d: %s: Warning: assertion failed, value %d.\n", filename, line, func, val); +#ifndef BTRFS_DISABLE_BACKTRACE if (trace) print_trace(); +#endif } -#define BUG() assert_trace(NULL, __FILE__, __func__, __LINE__, 0) -#else -#define BUG() assert(0) -#endif #ifdef __CHECKER__ #define __force __attribute__((force))