]> git.baikalelectronics.ru Git - kernel.git/commit
platform/x86: amd-pmc: Fix build error unused-function
authorRen Zhijie <renzhijie2@huawei.com>
Thu, 5 May 2022 12:19:58 +0000 (20:19 +0800)
committerHans de Goede <hdegoede@redhat.com>
Fri, 6 May 2022 11:02:56 +0000 (13:02 +0200)
commit361409ffd452174ef60365e38df8349e38d5479d
tree6f07957f7f186152d99f921adb81ad58940e1579
parent984427c62c258027ff4b49e6a2976e44c550eea9
platform/x86: amd-pmc: Fix build error unused-function

If CONFIG_SUSPEND and CONFIG_DEBUG_FS are not set.

compile error:
drivers/platform/x86/amd-pmc.c:323:12: error: ‘get_metrics_table’ defined but not used [-Werror=unused-function]
 static int get_metrics_table(struct amd_pmc_dev *pdev, struct smu_metrics *table)
            ^~~~~~~~~~~~~~~~~
drivers/platform/x86/amd-pmc.c:298:12: error: ‘amd_pmc_idlemask_read’ defined but not used [-Werror=unused-function]
 static int amd_pmc_idlemask_read(struct amd_pmc_dev *pdev, struct device *dev,
            ^~~~~~~~~~~~~~~~~~~~~
drivers/platform/x86/amd-pmc.c:196:12: error: ‘amd_pmc_get_smu_version’ defined but not used [-Werror=unused-function]
 static int amd_pmc_get_smu_version(struct amd_pmc_dev *dev)
            ^~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

To fix building warning, wrap all related code with CONFIG_SUSPEND or CONFIG_DEBUG_FS.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ren Zhijie <renzhijie2@huawei.com>
Link: https://lore.kernel.org/r/20220505121958.138905-1-renzhijie2@huawei.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/amd-pmc.c