drbd: check MODULE for THIS_MODULE
THIS_MODULE is NULL only when drbd is compiled as built-in, so the #ifdef CONFIG_MODULES should be #ifdef MODULE instead. This fixes the warning: 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: WANG Cong <xiyou.wangcong@gmail.com> Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
This commit is contained in:
committed by
Philipp Reisner
parent
f6d0a8dbfd
commit
bc4854bc91
@@ -4365,12 +4365,11 @@ const char *drbd_buildtag(void)
|
|||||||
static char buildtag[38] = "\0uilt-in";
|
static char buildtag[38] = "\0uilt-in";
|
||||||
|
|
||||||
if (buildtag[0] == 0) {
|
if (buildtag[0] == 0) {
|
||||||
#ifdef CONFIG_MODULES
|
#ifdef MODULE
|
||||||
if (THIS_MODULE != NULL)
|
sprintf(buildtag, "srcversion: %-24s", THIS_MODULE->srcversion);
|
||||||
sprintf(buildtag, "srcversion: %-24s", THIS_MODULE->srcversion);
|
#else
|
||||||
else
|
buildtag[0] = 'b';
|
||||||
#endif
|
#endif
|
||||||
buildtag[0] = 'b';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return buildtag;
|
return buildtag;
|
||||||
|
Reference in New Issue
Block a user