]> www.infradead.org Git - users/jedix/linux-maple.git/commit
buildid: fix build when CONFIG_MODULES is not set
authorRandy Dunlap <rdunlap@infradead.org>
Wed, 2 Jun 2021 03:53:28 +0000 (13:53 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 3 Jun 2021 08:17:07 +0000 (18:17 +1000)
commit5cbeea3e5cec3602553232a333c470de8ca495f0
tree275a038d9c4528eb0712d69fc065e8bc96112c6f
parentda956650e40529254e6c09c93dc16b58f7707188
buildid: fix build when CONFIG_MODULES is not set

Omit the static_assert() when CONFIG_MODULES is not set/enabled.
Fixes these build errors:

../kernel/kallsyms.c: In function `__sprint_symbol':
../include/linux/kernel.h:53:43: error: dereferencing pointer to incomplete type `struct module'
 #define typeof_member(T, m) typeof(((T*)0)->m)
                                           ^
../include/linux/build_bug.h:78:41: error: static assertion failed: "sizeof(typeof_member(struct module, build_id)) == 20"
 #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
                                         ^
../kernel/kallsyms.c:454:4: note: in expansion of macro `static_assert'
    static_assert(sizeof(typeof_member(struct module, build_id)) == 20);
    ^~~~~~~~~~~~~

Link: https://lkml.kernel.org/r/20210513171510.20328-1-rdunlap@infradead.org
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
kernel/kallsyms.c