From: Will Deacon Date: Tue, 8 Feb 2022 15:12:28 +0000 (+0000) Subject: perf/marvell_cn10k: Fix unused variable warning when W=1 and CONFIG_OF=n X-Git-Tag: v5.18-rc1~224^2~4^2~12 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=8c0c56879d067ad1e68c0aeeecc7d5f57bac3ffd;p=linux-block.git perf/marvell_cn10k: Fix unused variable warning when W=1 and CONFIG_OF=n The kbuild helpfully reports that the Marvell CN10K TAD PMU driver emits a warning when building with W=1 and CONFIG_OF=n: | >> drivers/perf/marvell_cn10k_tad_pmu.c:371:34: warning: unused variable 'tad_pmu_of_match' [-Wunused-const-variable] static const struct of_device_id tad_pmu_of_match[] = { Guard the match table with CONFIG_OF to squash the warning. Link: https://lore.kernel.org/r/202201292349.zRQLcDDD-lkp@intel.com Reported-by: kernel test robot Signed-off-by: Will Deacon --- diff --git a/drivers/perf/marvell_cn10k_tad_pmu.c b/drivers/perf/marvell_cn10k_tad_pmu.c index 7f4d292658e3..ee67305f822d 100644 --- a/drivers/perf/marvell_cn10k_tad_pmu.c +++ b/drivers/perf/marvell_cn10k_tad_pmu.c @@ -368,10 +368,12 @@ static int tad_pmu_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_OF static const struct of_device_id tad_pmu_of_match[] = { { .compatible = "marvell,cn10k-tad-pmu", }, {}, }; +#endif static struct platform_driver tad_pmu_driver = { .driver = {