Re: [PATCH] mm: memcontrol.c: move mem_cgroup_id_get_many under CONFIG_MMU

From: Chris Down
Date: Tue Dec 17 2019 - 10:09:25 EST


Michal Hocko writes:
yes, I would just ignore this warning. Btw. it seems that this is
enabled by default for -Wall. Is this useful for kernel builds at
all? Does it realistically help discovering real issues? If not then
can we simply blacklist it?

There's no way we're the first people to encounter these problems, so what did we do in the past when situations like this (adding a generic API which is not yet used by non-configurable code) came up, and in retrospect did they work well?

As far as I know -Wunused-function also guards against other errors, like when a function is prototyped but not actually defined, which might be more useful to know about.

(Side note: I'm moderately baffled that a tightly scoped __maybe_unused is considered sinister but somehow disabling -Wunused-function is on the table :-))