]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
genksyms: fix syntax error for builtin (u)int*x*_t types
authorMasahiro Yamada <masahiroy@kernel.org>
Mon, 13 Jan 2025 15:00:54 +0000 (00:00 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Sun, 26 Jan 2025 22:44:16 +0000 (07:44 +0900)
A longstanding issue with genksyms is that it has hidden syntax errors.

When a syntax error occurs, yyerror() is called. However,
error_with_pos() is a no-op unless the -w option is provided.

You can observe syntax errors by manually passing the -w option.

For example, genksyms fails to parse the following code in
arch/arm64/lib/xor-neon.c:

    static inline uint64x2_t eor3(uint64x2_t p, uint64x2_t q, uint64x2_t r)
    {
            [ snip ]
    }

The syntax error occurs because genksyms does not recognize the
uint64x2_t keyword.

This commit adds support for builtin types described in Arm Neon
Intrinsics Reference.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Nicolas Schier <n.schier@avm.de>
scripts/genksyms/lex.l

index a1f969dcf24f177ed25b82dda82090cfaec188b6..22aeb57649d9ce90dce7634e600d2845d9b6bdb3 100644 (file)
@@ -51,6 +51,7 @@ MC_TOKEN              ([~%^&*+=|<>/-]=)|(&&)|("||")|(->)|(<<)|(>>)
 
 %%
 
+u?int(8|16|32|64)x(1|2|4|8|16)_t       return BUILTIN_INT_KEYW;
 
  /* Keep track of our location in the original source files.  */
 ^#[ \t]+{INT}[ \t]+\"[^\"\n]+\".*\n    return FILENAME;