[PATCH] net/bpf_jit: SPARC: drop unneeded semicolon

Julia Lawall posted 1 patch an hour ago
arch/sparc/net/bpf_jit_comp_32.c |    4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] net/bpf_jit: SPARC: drop unneeded semicolon
Posted by Julia Lawall an hour ago
When a function-like macro expands to an expression, that expression
doesn't need a semicolon after it.  All uses have been verified to
have their own semicolons.

This was found using the following Coccinelle semantic patch:

@r@
identifier i : script:ocaml() { String.lowercase_ascii i = i };
expression e;
@@

*#define i(...) e;

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>

---
 arch/sparc/net/bpf_jit_comp_32.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/sparc/net/bpf_jit_comp_32.c b/arch/sparc/net/bpf_jit_comp_32.c
index bda2dbd3f..632002681 100644
--- a/arch/sparc/net/bpf_jit_comp_32.c
+++ b/arch/sparc/net/bpf_jit_comp_32.c
@@ -262,13 +262,13 @@ do {	*prog++ = BR_OPC | WDISP22(OFF);		\
 	*prog++ = (SUBCC | RS1(R1) | RS2(R2) | RD(G0))
 
 #define emit_cmpi(R1, IMM) \
-	*prog++ = (SUBCC | IMMED | RS1(R1) | S13(IMM) | RD(G0));
+	*prog++ = (SUBCC | IMMED | RS1(R1) | S13(IMM) | RD(G0))
 
 #define emit_btst(R1, R2) \
 	*prog++ = (ANDCC | RS1(R1) | RS2(R2) | RD(G0))
 
 #define emit_btsti(R1, IMM) \
-	*prog++ = (ANDCC | IMMED | RS1(R1) | S13(IMM) | RD(G0));
+	*prog++ = (ANDCC | IMMED | RS1(R1) | S13(IMM) | RD(G0))
 
 #define emit_sub(R1, R2, R3) \
 	*prog++ = (SUB | RS1(R1) | RS2(R2) | RD(R3))
Re: [PATCH] net/bpf_jit: SPARC: drop unneeded semicolon
Posted by bot+bpf-ci@kernel.org 59 minutes ago
> net/bpf_jit: SPARC: drop unneeded semicolon
>
>     When a function-like macro expands to an expression, that expression
>     doesn't need a semicolon after it.  All uses have been verified to
>     have their own semicolons.
>
>     This was found using the following Coccinelle semantic patch:
>
>     @r@
>     identifier i : script:ocaml() { String.lowercase_ascii i = i };
>     expression e;
>     @@
>
>     *#define i(...) e;
>
>     Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>

The change itself looks right.  Both emit_cmpi() and emit_btsti() are
only used from bpf_jit_compile(), and every one of those six call sites
already ends in its own semicolon, so the expansions stay well formed.

This isn't a bug, but would a prefix like "bpf, sparc:" fit better here?
The changed file is arch/sparc/net/bpf_jit_comp_32.c rather than anything
under net/, and earlier patches touching this file used prefixes along
the lines of "bpf, sparc:", "bpf, sparc64:" or "sparc: bpf:".


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/30714427730