From: Julia Lawall <julia.lawall@inria.fr>
To: Waiman Long <longman@redhat.com>
Cc: "Tejun Heo" <tj@kernel.org>,
kernel-janitors@vger.kernel.org,
"Johannes Weiner" <hannes@cmpxchg.org>,
"Michal Koutný" <mkoutny@suse.com>,
cgroups@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cgroup: drop unneeded semicolon
Date: Sun, 2 Aug 2026 08:47:01 +0200 (CEST) [thread overview]
Message-ID: <edfb8ac2-ef9-1a8b-4355-309644d71d33@inria.fr> (raw)
In-Reply-To: <8797e8b8-59ce-4934-ac0c-7f9731de454b@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1875 bytes --]
On Sat, 1 Aug 2026, Waiman Long wrote:
> On 8/1/26 3:09 PM, Julia Lawall wrote:
> > 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>
> >
> > ---
> > kernel/cgroup/cgroup.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
> > index 38f8d9df8..f87fc4550 100644
> > --- a/kernel/cgroup/cgroup.c
> > +++ b/kernel/cgroup/cgroup.c
> > @@ -104,7 +104,7 @@ DEFINE_PERCPU_RWSEM(cgroup_threadgroup_rwsem);
> > #define cgroup_assert_mutex_or_rcu_locked() \
> > RCU_LOCKDEP_WARN(!rcu_read_lock_held() && \
> > !lockdep_is_held(&cgroup_mutex), \
> > - "cgroup_mutex or RCU read lock required");
> > + "cgroup_mutex or RCU read lock required")
> > /*
> > * cgroup destruction makes heavy use of work items and there can be a lot
> >
> The RCU_LOCKDEP_WARN() macro is basically a "do { ...} while (0...)"
> statement. It doesn't have a ';' at the end. So your commit log isn't right.
OK. Indeed I didn't take into account the definition of the macro. The
usage context does have another semincolon, which is what is mentioned in
the commit log.
>
> An additional semicolon at the end doesn't harm. By removing the semicolon,
> even if not needed, may make people wonder if it is right when reading the
> code wasting their time to figure out if it is all right. So I don't see any
> advantage in removing it.
No problem to drop the patch if you don't think it's useful.
julia
next prev parent reply other threads:[~2026-08-02 6:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-01 19:09 [PATCH] cgroup: drop unneeded semicolon Julia Lawall
2026-08-01 23:37 ` Waiman Long
2026-08-02 3:11 ` Tejun Heo
2026-08-02 3:31 ` Waiman Long
2026-08-02 6:47 ` Julia Lawall [this message]
2026-08-02 19:02 ` Tejun Heo
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=edfb8ac2-ef9-1a8b-4355-309644d71d33@inria.fr \
--to=julia.lawall@inria.fr \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mkoutny@suse.com \
--cc=tj@kernel.org \
/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