Re: [PATCH] cgroup: drop unneeded semicolon
From: Waiman Long
Date: Sat Aug 01 2026 - 23:33:00 EST
On 8/1/26 11:11 PM, Tejun Heo wrote:
Hello,
On Sat, Aug 01, 2026 at 07:37:13PM -0400, Waiman Long wrote:
I think the extra semicolon can hurt. Imagine something like this:diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.cThe RCU_LOCKDEP_WARN() macro is basically a "do { ...} while (0...)"
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
statement. It doesn't have a ';' at the end. So your commit log isn't
right.
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.
if (blah)
cgroup_assert_mutex_or_rcu_locked();
else
something else;
This should work but with the extra semicolon, it doesn't. I don't see why
we wouldn't fix this. It's obviously wrong.
OK, I think I have misread the patch. Right, the extra ';' should be removed. Sorry for the noise.
Cheers,
Longman