[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1332173487-14167-1-git-send-email-uwe@kleine-koenig.org>
Date: Mon, 19 Mar 2012 17:11:27 +0100
From: Uwe Kleine-König <uwe@...ine-koenig.org>
To: Lars Ellenberg <drbd-dev@...ts.linbit.com>
Cc: drbd-user@...ts.linbit.com, linux-kernel@...r.kernel.org
Subject: [PATCH] block/drbd: simplify drbd_buildtag fixing a build warning
This fixes:
drivers/block/drbd/drbd_main.c: In function ‘drbd_buildtag’:
drivers/block/drbd/drbd_main.c:4187:24: warning: the comparison will always evaluate as ‘true’ for the address of ‘__this_module’ will never be NULL [-Waddress]
Signed-off-by: Uwe Kleine-König <uwe@...ine-koenig.org>
---
drivers/block/drbd/drbd_main.c | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 211fc44..9cc7178 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -4177,21 +4177,19 @@ _drbd_insert_fault(struct drbd_conf *mdev, unsigned int type)
const char *drbd_buildtag(void)
{
+#if IS_MODULE(CONFIG_BLK_DEV_DRBD)
/* DRBD built from external sources has here a reference to the
git hash of the source code. */
- static char buildtag[38] = "\0uilt-in";
+ static char buildtag[38] = "\0";
- if (buildtag[0] == 0) {
-#ifdef CONFIG_MODULES
- if (THIS_MODULE != NULL)
- sprintf(buildtag, "srcversion: %-24s", THIS_MODULE->srcversion);
- else
-#endif
- buildtag[0] = 'b';
- }
+ if (buildtag[0] == '\0')
+ sprintf(buildtag, "srcversion: %-24s", THIS_MODULE->srcversion);
return buildtag;
+#else
+ return "built-in";
+#endif
}
module_init(drbd_init)
--
1.7.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists