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

- From: Arnd Bergmann \<arnd@kernel.org\>
- Date: 2021-03-30 09:01:47 
- List: linux-arm-kernel
- Page: https://ratatoskr.run/linux-arm-kernel/2021/03/6320902
- Thread: https://ratatoskr.run/linux-arm-kernel/2021/03/6310878/t.md

```text
On Tue, Mar 30, 2021 at 10:41 AM Michal Koutný [ref] wrote:
>
> On Mon, Mar 22, 2021 at 05:02:44PM +0100, Arnd Bergmann [ref] wrote:
> > I'm not sure what is expected to happen for such a configuration,
> > presumably these functions are never calls in that case.
> Yes, the functions you patched would only be called from subsystems or
> there should be no way to obtain a struct cgroup_subsys reference
> anyway (hence it's ok to always branch as if ss==NULL).
>
> I'd prefer a variant that wouldn't compile the affected codepaths when
> there are no subsystems registered, however, I couldn't come up with a
> way how to do it without some preprocessor ugliness.

Would it be possible to enclose most or all of kernel/cgroup/cgroup.c
in an #ifdef CGROUP_SUBSYS_COUNT block? 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).

> Reviewed-by: Michal Koutný <mkoutny@suse.com>

Thanks

        Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
```
