Skip to content

Commit 3a176b9

Browse files
masahir0ytorvalds
authored andcommitted
Revert "kbuild: avoid static_assert for genksyms"
This reverts commit 14dc398. Macro Elver had sent a fix proper fix earlier, and also pointed out corner cases: "I guess what you propose is simpler, but might still have corner cases where we still get warnings. In particular, if some file (for whatever reason) does not include build_bug.h and uses a raw _Static_assert(), then we still get warnings. E.g. I see 1 user of raw _Static_assert() (drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h )." I believe the raw use of _Static_assert() should be allowed, so this should be fixed in genksyms. Even after commit 14dc398 ("kbuild: avoid static_assert for genksyms"), I confirmed the following test code emits the warning. ---------------->8---------------- #include <linux/export.h> _Static_assert((1 ?: 0), ""); void foo(void) { } EXPORT_SYMBOL(foo); ---------------->8---------------- WARNING: modpost: EXPORT symbol "foo" [vmlinux] version generation failed, symbol will not be versioned. Now that commit 869b91992bce ("genksyms: Ignore module scoped _Static_assert()") fixed this issue properly, the workaround should be reverted. Link: https://lkml.org/lkml/2020/12/10/845 Link: https://lkml.kernel.org/r/20201219183911.181442-1-masahiroy@kernel.org Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Cc: Marco Elver <elver@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent e7dd91c commit 3a176b9

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

‎include/linux/build_bug.h‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,4 @@
7777
#define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
7878
#define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
7979

80-
#ifdef __GENKSYMS__
81-
/* genksyms gets confused by _Static_assert */
82-
#define _Static_assert(expr, ...)
83-
#endif
84-
8580
#endif /* _LINUX_BUILD_BUG_H */

0 commit comments

Comments
 (0)