]> git.baikalelectronics.ru Git - kernel.git/commit
platform/x86: intel_pmc_core: avoid unused-function warnings
authorArnd Bergmann <arnd@arndb.de>
Tue, 28 Apr 2020 21:36:38 +0000 (23:36 +0200)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 5 May 2020 17:26:16 +0000 (20:26 +0300)
commit61c27d6cff1f9cd0eecf5edf8b4d8cf584b93e97
tree999c4eca448ed364f06158355932457b769e901c
parent7ad7f327820185a96739f5c6fc20c47d2f585db5
platform/x86: intel_pmc_core: avoid unused-function warnings

When both CONFIG_DEBUG_FS and CONFIG_PM_SLEEP are disabled, the
functions that got moved out of the #ifdef section now cause
a warning:

drivers/platform/x86/intel_pmc_core.c:654:13: error: 'pmc_core_lpm_display' defined but not used [-Werror=unused-function]
  654 | static void pmc_core_lpm_display(struct pmc_dev *pmcdev, struct device *dev,
      |             ^~~~~~~~~~~~~~~~~~~~
drivers/platform/x86/intel_pmc_core.c:617:13: error: 'pmc_core_slps0_display' defined but not used [-Werror=unused-function]
  617 | static void pmc_core_slps0_display(struct pmc_dev *pmcdev, struct device *dev,
      |             ^~~~~~~~~~~~~~~~~~~~~~

Rather than add even more #ifdefs here, remove them entirely and
let the compiler work it out, it can actually get rid of all the
debugfs calls without problems as long as the struct member is
there.

The two PM functions just need a __maybe_unused annotations to avoid
another warning instead of the #ifdef.

Fixes: 565ad2407b5c ("platform/x86: intel_pmc_core: Relocate pmc_core_*_display() to outside of CONFIG_DEBUG_FS")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/intel_pmc_core.c
drivers/platform/x86/intel_pmc_core.h