btrfs-progs: kerncompat: simplify warning_trace

The value of assertion is always set.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2017-01-24 16:05:24 +01:00
parent bc2d4ccc46
commit 6b62b76470
1 changed files with 3 additions and 8 deletions

View File

@ -93,14 +93,9 @@ static inline void warning_trace(const char *assertion, const char *filename,
{ {
if (!val) if (!val)
return; return;
if (assertion) fprintf(stderr,
fprintf(stderr, "%s:%d: %s: Warning: assertion `%s` failed, value %ld\n",
"%s:%d: %s: Warning: assertion `%s` failed, value %ld\n", filename, line, func, assertion, val);
filename, line, func, assertion, val);
else
fprintf(stderr,
"%s:%d: %s: Warning: assertion failed, value %ld.\n",
filename, line, func, val);
#ifndef BTRFS_DISABLE_BACKTRACE #ifndef BTRFS_DISABLE_BACKTRACE
print_trace(); print_trace();
#endif #endif