drbd: Replace the ERR_IF macro with an assert-like macro
Remove the file name and line number from the syslog messages generated:
we have no duplicate function names, and no function contains the same
assertion more than once.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 19176a1..46ba4aa 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -1810,7 +1810,7 @@
p == mdev->receiver.task ? &mdev->receiver :
p == mdev->worker.task ? &mdev->worker :
NULL;
- ERR_IF(thi == NULL)
+ if (!expect(thi != NULL))
return;
if (!thi->reset_cpu_mask)
return;
@@ -1826,8 +1826,10 @@
{
int sent, ok;
- ERR_IF(!h) return false;
- ERR_IF(!size) return false;
+ if (!expect(h))
+ return false;
+ if (!expect(size))
+ return false;
h->magic = cpu_to_be32(DRBD_MAGIC);
h->command = cpu_to_be16(cmd);
@@ -2300,7 +2302,8 @@
struct p_header80 *p;
int err;
- ERR_IF(!mdev->bitmap) return false;
+ if (!expect(mdev->bitmap))
+ return false;
/* maybe we should use some per thread scratch page,
* and allocate that during initial device creation? */
@@ -3255,7 +3258,7 @@
dev_err(DEV, "open_cnt = %d in %s:%u", mdev->open_cnt,
__FILE__ , __LINE__);
- ERR_IF (!list_empty(&mdev->data.work.q)) {
+ if (!expect(list_empty(&mdev->data.work.q))) {
struct list_head *lp;
list_for_each(lp, &mdev->data.work.q) {
dev_err(DEV, "lp = %p\n", lp);