drbd: unify how failed assertions are logged
authorChristoph Böhmwalder <christoph.boehmwalder@linbit.com>
Thu, 1 Dec 2022 11:03:46 +0000 (12:03 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 1 Dec 2022 18:33:49 +0000 (11:33 -0700)
Unify how failed assertions from D_ASSERT() and expect() are logged.

Originally-from: Andreas Gruenbacher <agruen@linbit.com>
Signed-off-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
Link: https://lore.kernel.org/r/20221201110349.1282687-2-christoph.boehmwalder@linbit.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/drbd/drbd_int.h

index e29bd10..ea92df7 100644 (file)
@@ -122,9 +122,11 @@ void drbd_printk_with_wrong_object_type(void);
 #define dynamic_drbd_dbg(device, fmt, args...) \
        dynamic_dev_dbg(disk_to_dev(device->vdisk), fmt, ## args)
 
-#define D_ASSERT(device, exp)  do { \
-       if (!(exp)) \
-               drbd_err(device, "ASSERT( " #exp " ) in %s:%d\n", __FILE__, __LINE__); \
+#define D_ASSERT(x, exp)                                                       \
+       do {                                                                    \
+               if (!(exp))                                                     \
+                       drbd_err(x, "ASSERTION %s FAILED in %s\n",              \
+                                #exp, __func__);                               \
        } while (0)
 
 /**