Re: [PATCH 06/11] cgroup: fix -Wzero-length-bounds warnings

From
Michal Koutný <mkoutny@suse.com>
Date
2021-03-30 14:45:45
Also in
ath11k, cgroups, dri-devel, intel-gfx, linux-arm-kernel, linux-scsi, linux-security-module, lkml, netdev
Reply to
Arnd Bergmann, 2021-03-30
On Tue, Mar 30, 2021 at 11:00:36AM +0200, Arnd Bergmann [off-list ref] wrote:
Would it be possible to enclose most or all of kernel/cgroup/cgroup.c
in an #ifdef CGROUP_SUBSYS_COUNT block?
Even without any controllers, there can still be named hierarchies (v1)
or the default hierarchy (v2) (for instance) for process tracking
purposes. So only parts of kernel/cgroup/cgroup.c could be ifdef'd.

Beware that CGROUP_SUBSYS_COUNT is not known at preprocessing stage (you
could have a macro alternative though).
I didn't try that myself, but this might be a way to guarantee that
there cannot be any callers (it would cause a link error).
Such a guarantee would be nicer, I agree. I tried a bit but anandoned it
when I saw macros proliferate (which I found less readable than your
current variant). But YMMV.

Michal

Attachments

Thread (32 messages) 32 messages, 12 authors, last reply 2021-09-28
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help