Skip to content

Commit 1013f56

Browse files
ubizjakIngo Molnar
authored andcommitted
genksyms: Handle typeof_unqual keyword and __seg_{fs,gs} qualifiers
Handle typeof_unqual, __typeof_unqual and __typeof_unqual__ keywords using TYPEOF_KEYW token in the same way as typeof keyword. Also ignore x86 __seg_fs and __seg_gs named address space qualifiers using X86_SEG_KEYW token in the same way as const, volatile or restrict qualifiers. Fixes: ac05394 ("compiler.h: introduce TYPEOF_UNQUAL() macro") Closes: https://lore.kernel.org/lkml/81a25a60-de78-43fb-b56a-131151e1c035@molgen.mpg.de/ Reported-by: Paul Menzel <pmenzel@molgen.mpg.de> Signed-off-by: Uros Bizjak <ubizjak@gmail.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Link: https://lore.kernel.org/r/20250413220749.270704-1-ubizjak@gmail.com
1 parent d833dc5 commit 1013f56

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

scripts/genksyms/keywords.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ static struct resword {
1717
{ "__signed__", SIGNED_KEYW },
1818
{ "__typeof", TYPEOF_KEYW },
1919
{ "__typeof__", TYPEOF_KEYW },
20+
{ "__typeof_unqual", TYPEOF_KEYW },
21+
{ "__typeof_unqual__", TYPEOF_KEYW },
2022
{ "__volatile", VOLATILE_KEYW },
2123
{ "__volatile__", VOLATILE_KEYW },
2224
{ "__builtin_va_list", VA_LIST_KEYW },
@@ -40,6 +42,10 @@ static struct resword {
4042
// KAO. },
4143
// { "attribute", ATTRIBUTE_KEYW },
4244

45+
// X86 named address space qualifiers
46+
{ "__seg_gs", X86_SEG_KEYW },
47+
{ "__seg_fs", X86_SEG_KEYW },
48+
4349
{ "auto", AUTO_KEYW },
4450
{ "char", CHAR_KEYW },
4551
{ "const", CONST_KEYW },
@@ -57,6 +63,7 @@ static struct resword {
5763
{ "struct", STRUCT_KEYW },
5864
{ "typedef", TYPEDEF_KEYW },
5965
{ "typeof", TYPEOF_KEYW },
66+
{ "typeof_unqual", TYPEOF_KEYW },
6067
{ "union", UNION_KEYW },
6168
{ "unsigned", UNSIGNED_KEYW },
6269
{ "void", VOID_KEYW },

scripts/genksyms/parse.y

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ static void record_compound(struct string_list **keyw,
9191
%token TYPEOF_KEYW
9292
%token VA_LIST_KEYW
9393

94+
%token X86_SEG_KEYW
95+
9496
%token EXPORT_SYMBOL_KEYW
9597

9698
%token ASM_PHRASE
@@ -292,7 +294,8 @@ type_qualifier_seq:
292294
;
293295

294296
type_qualifier:
295-
CONST_KEYW | VOLATILE_KEYW
297+
X86_SEG_KEYW
298+
| CONST_KEYW | VOLATILE_KEYW
296299
| RESTRICT_KEYW
297300
{ /* restrict has no effect in prototypes so ignore it */
298301
remove_node($1);

0 commit comments

Comments
 (0)