]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
genksyms: Handle typeof_unqual keyword and __seg_{fs,gs} qualifiers
authorUros Bizjak <ubizjak@gmail.com>
Sun, 13 Apr 2025 22:07:34 +0000 (00:07 +0200)
committerIngo Molnar <mingo@kernel.org>
Mon, 14 Apr 2025 07:19:04 +0000 (09:19 +0200)
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: ac053946f5c4 ("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
scripts/genksyms/keywords.c
scripts/genksyms/parse.y

index b85e0979a00cecc5b3c2db0136428cc8deb904b1..ee1499d27061763dee0a4bd32cbc8541a81479ef 100644 (file)
@@ -17,6 +17,8 @@ static struct resword {
        { "__signed__", SIGNED_KEYW },
        { "__typeof", TYPEOF_KEYW },
        { "__typeof__", TYPEOF_KEYW },
+       { "__typeof_unqual", TYPEOF_KEYW },
+       { "__typeof_unqual__", TYPEOF_KEYW },
        { "__volatile", VOLATILE_KEYW },
        { "__volatile__", VOLATILE_KEYW },
        { "__builtin_va_list", VA_LIST_KEYW },
@@ -40,6 +42,10 @@ static struct resword {
        // KAO. },
        // { "attribute", ATTRIBUTE_KEYW },
 
+       // X86 named address space qualifiers
+       { "__seg_gs", X86_SEG_KEYW },
+       { "__seg_fs", X86_SEG_KEYW },
+
        { "auto", AUTO_KEYW },
        { "char", CHAR_KEYW },
        { "const", CONST_KEYW },
@@ -57,6 +63,7 @@ static struct resword {
        { "struct", STRUCT_KEYW },
        { "typedef", TYPEDEF_KEYW },
        { "typeof", TYPEOF_KEYW },
+       { "typeof_unqual", TYPEOF_KEYW },
        { "union", UNION_KEYW },
        { "unsigned", UNSIGNED_KEYW },
        { "void", VOID_KEYW },
index ee600a804fa103411be21b52c856bedf3917489b..efdcf07c4eb6da8c595fca5c0cd2325eeb54fd4c 100644 (file)
@@ -91,6 +91,8 @@ static void record_compound(struct string_list **keyw,
 %token TYPEOF_KEYW
 %token VA_LIST_KEYW
 
+%token X86_SEG_KEYW
+
 %token EXPORT_SYMBOL_KEYW
 
 %token ASM_PHRASE
@@ -292,7 +294,8 @@ type_qualifier_seq:
        ;
 
 type_qualifier:
-       CONST_KEYW | VOLATILE_KEYW
+       X86_SEG_KEYW
+       | CONST_KEYW | VOLATILE_KEYW
        | RESTRICT_KEYW
                { /* restrict has no effect in prototypes so ignore it */
                  remove_node($1);