lkml.org 
[lkml]   [2012]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] block/drbd: simplify drbd_buildtag fixing a build warning
Date
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/

\
 
 \ /
  Last update: 2012-03-19 17:15    [W:0.023 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site