From c3f8974198b41965c8f62099ba97f1293561cab2 Mon Sep 17 00:00:00 2001 From: Christoph Böhmwalder Date: Thu, 1 Dec 2022 12:03:46 +0100 Subject: drbd: unify how failed assertions are logged MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unify how failed assertions from D_ASSERT() and expect() are logged. Originally-from: Andreas Gruenbacher Signed-off-by: Christoph Böhmwalder Link: https://lore.kernel.org/r/20221201110349.1282687-2-christoph.boehmwalder@linbit.com Signed-off-by: Jens Axboe --- drivers/block/drbd/drbd_int.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/block') diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index e29bd10ac52f..ea92df778c66 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h @@ -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) /** -- cgit v1.2.3