Messages in this thread Patch in this message | | | From | Uwe Kleine-König <> | Subject | [PATCH] block/drbd: simplify drbd_buildtag fixing a build warning | Date | Mon, 19 Mar 2012 17:11:27 +0100 |
| |
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@kleine-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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |