Skip to content

Commit 152d8e8

Browse files
committed
kallsyms: explain why the _Static_assert is needed
Suggested-by: Boqun Feng <boqun.feng@gmail.com> Suggested-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/lkml/202208171330.BB5B081D1@keescook/ Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent 8914231 commit 152d8e8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

scripts/kallsyms.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@
3232

3333
#define KSYM_NAME_LEN 512
3434

35-
/* A substantially bigger size than the current maximum. */
35+
/*
36+
* A substantially bigger size than the current maximum.
37+
*
38+
* It cannot be defined as an expression because it gets stringified
39+
* for the fscanf() format string. Therefore, a _Static_assert() is
40+
* used instead to maintain the relationship with KSYM_NAME_LEN.
41+
*/
3642
#define KSYM_NAME_LEN_BUFFER 2048
3743
_Static_assert(
3844
KSYM_NAME_LEN_BUFFER == KSYM_NAME_LEN * 4,

0 commit comments

Comments
 (0)