psi: Fix "defined but not used" warnings when CONFIG_PROC_FS=n
authorSuren Baghdasaryan <surenb@google.com>
Wed, 19 Jan 2022 22:39:40 +0000 (14:39 -0800)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 27 Jan 2022 11:57:19 +0000 (12:57 +0100)
commit5102bb1c9f82857a3164af9d7ab7ad628cb783ed
tree4f51103e1bc5286a379e3587baaa310c60eae0dd
parentd37aee9018e68b0d356195caefbb651910e0bbfa
psi: Fix "defined but not used" warnings when CONFIG_PROC_FS=n

When CONFIG_PROC_FS is disabled psi code generates the following warnings:

kernel/sched/psi.c:1364:30: warning: 'psi_cpu_proc_ops' defined but not used [-Wunused-const-variable=]
    1364 | static const struct proc_ops psi_cpu_proc_ops = {
         |                              ^~~~~~~~~~~~~~~~
kernel/sched/psi.c:1355:30: warning: 'psi_memory_proc_ops' defined but not used [-Wunused-const-variable=]
    1355 | static const struct proc_ops psi_memory_proc_ops = {
         |                              ^~~~~~~~~~~~~~~~~~~
kernel/sched/psi.c:1346:30: warning: 'psi_io_proc_ops' defined but not used [-Wunused-const-variable=]
    1346 | static const struct proc_ops psi_io_proc_ops = {
         |                              ^~~~~~~~~~~~~~~

Make definitions of these structures and related functions conditional on
CONFIG_PROC_FS config.

Fixes: 0e94682b73bf ("psi: introduce psi monitor")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20220119223940.787748-3-surenb@google.com
kernel/sched/psi.c