Re: [PATCH v2 2/4] selftests: riscv: Add braces around EXPECT_EQ()

Paul Walmsley
2026-03-21T00:24:22Z

[-- Attachment #1: Type: text/plain, Size: 681 bytes --]

On Mon, 9 Mar 2026, Charlie Jenkins via B4 Relay wrote:

> From: Charlie Jenkins <thecharlesjenkins@gmail.com>
>
> EXPECT_EQ() expands to multiple lines, breaking up one-line if
> statements. This issue was not present in the patch on the mailing list
> but was instead introduced by the maintainer when attempting to fix up
> checkpatch warnings. Add braces around EXPECT_EQ() to avoid the error
> even though checkpatch suggests them to be removed:
>
> validate_v_ptrace.c:626:17: error: ‘else’ without a previous ‘if’

That's annoying. Can't the macro body be wrapped in do { ... } while (0);
instead, rather than adding these permanent checkpatch warnings?

- Paul