summaryrefslogtreecommitdiff
path: root/include/linux/bug.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-05-17 16:47:05 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2021-05-17 16:48:48 -0400
commit2e2d5a3f7ed4f6d4e2a45011a82386ba82cd3976 (patch)
tree533b857dfd5b734ae1a8f6e61202c2b55153f5b2 /include/linux/bug.h
parent8f72e6940c0bdf5cc1f1e0faf13b9e7a781161c6 (diff)
Update bcachefs sources to 0cd3e1d27a bcachefs: Fix for bch2_bkey_pack_pos() not initializing len/version fields
Diffstat (limited to 'include/linux/bug.h')
-rw-r--r--include/linux/bug.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/linux/bug.h b/include/linux/bug.h
index d47f5a49..77260f37 100644
--- a/include/linux/bug.h
+++ b/include/linux/bug.h
@@ -29,10 +29,15 @@
__ret_warn_on; \
})
+#define __WARN() \
+do { \
+ fprintf(stderr, "WARNING at " __FILE__ ":%d\n", __LINE__); \
+} while (0)
+
#define WARN_ON(cond) ({ \
int __ret_warn_on = unlikely(!!(cond)); \
if (__ret_warn_on) \
- fprintf(stderr, "WARNING at " __FILE__ ":%d\n", __LINE__);\
+ __WARN(); \
__ret_warn_on; \
})
@@ -42,8 +47,7 @@
int __ret_warn_on = unlikely(!!(cond)); \
if (__ret_warn_on && !__warned) { \
__warned = true; \
- fprintf(stderr, "WARNING at " __FILE__ ":%d: " fmt "\n",\
- __LINE__, ##__VA_ARGS__); \
+ __WARN(); \
} \
__ret_warn_on; \
})
@@ -53,7 +57,7 @@
int __ret_warn_on = unlikely(!!(cond)); \
if (__ret_warn_on && !__warned) { \
__warned = true; \
- fprintf(stderr, "WARNING at " __FILE__ ":%d\n", __LINE__);\
+ __WARN(); \
} \
__ret_warn_on; \
})