Re: [PATCH v3 5/7] kernel: Use mutable list iterators
Eduard Zingerman <[email protected]> Mon, 22 Jun 2026 12:03:46 -0700
| Newsgroups | org.kernel.vger.audit,dev.linux.lists.llvm,dev.linux.lists.sched-ext,org.freedesktop.lists.dri-devel,org.kernel.vger.bpf,org.kernel.vger.cgroups,org.kernel.vger.linux-crypto,org.kernel.vger.linux-kernel,org.kernel.vger.linux-modules,org.kernel.vger.linux-perf-users,org.kernel.vger.linux-pm,org.kernel.vger.linux-trace-kernel,org.kernel.vger.live-patching,org.kernel.vger.netdev,org.kernel.vger.rcu |
|---|---|
| Message-ID | <[email protected]> |
On Mon, 2026-06-22 at 12:28 +0800, Kaitao Cheng wrote: > From: Kaitao Cheng <[email protected]> > > The safe list iteration helpers require callers to provide a temporary > cursor even when the cursor is only used internally by the loop. This > leaves many functions with otherwise unused variables whose only purpose > is to satisfy the old iterator interface. > > Use the mutable list iteration helpers for those cases. The mutable > helpers keep the same removal-safe traversal semantics, while allowing > the temporary cursor to be internal to the macro when the caller does > not need to observe it. > > Convert list, hlist and llist users under kernel/ where the temporary > cursor is not used outside the iteration. Keep the explicit cursor form > where the next entry is still needed by the surrounding code. > > No functional change intended. > > Signed-off-by: Kaitao Cheng <[email protected]> > --- Beside the fact that this does not apply, I don't see a reason why is this needed for BPF sub-tree. [...]