From: Paul Walmsley <pjw@kernel.org>
To: Charlie Jenkins <thecharlesjenkins@gmail.com>
Cc: Shuah Khan <shuah@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Sergey Matyukevich <geomatsi@gmail.com>,
Andy Chiu <andybnac@gmail.com>,
Deepak Gupta <debug@rivosinc.com>,
linux-kselftest@vger.kernel.org,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/4] selftests: riscv: Add braces around EXPECT_EQ()
Date: Fri, 3 Apr 2026 11:46:53 -0600 (MDT) [thread overview]
Message-ID: <34fbc75a-ae74-8337-3107-80957707bc8f@kernel.org> (raw)
In-Reply-To: <d79b23d2-f8e8-b92e-cad4-5cbdf7690f12@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 1326 bytes --]
On Fri, 20 Mar 2026, Paul Walmsley wrote:
> 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?
I guess you haven't had the chance to take a look at this. Or maybe you
took a look at the kselftest harness macro mess and just decided not to
say anything ;-) I did look, after not hearing back, and the way those
macros are used would make it a big and painful lift to straighten out -
definitely not something for the -rc time frame.
So in the short term, I'm planning to take this as a fix to deal with the
immediate issue.
checkpatch.pl clearly needs to be patched to assume that these kselftest
harness macros don't follow the rules. Care to take that on?
- Paul
next prev parent reply other threads:[~2026-04-03 17:47 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-10 1:52 [PATCH v2 0/4] selftests: riscv: Fix compilation issues for v_ptrace and cfi Charlie Jenkins via B4 Relay
2026-03-10 1:52 ` [PATCH v2 1/4] selftests: riscv: Add definition of BIT() macro Charlie Jenkins via B4 Relay
2026-03-10 8:18 ` Sergey Matyukevich
2026-03-21 0:48 ` Paul Walmsley
2026-03-21 0:53 ` Paul Walmsley
2026-03-10 1:52 ` [PATCH v2 2/4] selftests: riscv: Add braces around EXPECT_EQ() Charlie Jenkins via B4 Relay
2026-03-10 3:50 ` Joe Perches
2026-03-10 8:17 ` Sergey Matyukevich
2026-03-21 0:24 ` Paul Walmsley
2026-04-03 17:46 ` Paul Walmsley [this message]
2026-03-10 1:52 ` [PATCH v2 3/4] riscv: ptrace: Fix BIT() compilation issues Charlie Jenkins via B4 Relay
2026-03-10 2:58 ` Deepak Gupta
2026-03-21 0:53 ` Paul Walmsley
2026-03-10 1:52 ` [PATCH v2 4/4] selftests: riscv: Add license to cfi selftest Charlie Jenkins via B4 Relay
2026-03-10 2:58 ` Deepak Gupta
2026-03-21 0:54 ` Paul Walmsley
2026-03-21 5:20 ` [PATCH v2 0/4] selftests: riscv: Fix compilation issues for v_ptrace and cfi patchwork-bot+linux-riscv
2026-04-03 18:30 ` patchwork-bot+linux-riscv
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=34fbc75a-ae74-8337-3107-80957707bc8f@kernel.org \
--to=pjw@kernel.org \
--cc=andybnac@gmail.com \
--cc=debug@rivosinc.com \
--cc=geomatsi@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=shuah@kernel.org \
--cc=thecharlesjenkins@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox