From: Will Deacon Date: Tue, 4 Jan 2022 13:34:12 +0000 (+0000) Subject: perf/smmuv3: Fix unused variable warning when CONFIG_OF=n X-Git-Tag: baikal/mips/sdk6.1~6758^2~3 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=bba1b2989c0f39f5d224762c5303f6817c642ec0;p=kernel.git perf/smmuv3: Fix unused variable warning when CONFIG_OF=n The kbuild robot reports that building the SMMUv3 PMU driver with CONFIG_OF=n results in a warning for W=1 builds: >> drivers/perf/arm_smmuv3_pmu.c:889:34: warning: unused variable 'smmu_pmu_of_match' [-Wunused-const-variable] static const struct of_device_id smmu_pmu_of_match[] = { ^ Guard the match table with #ifdef CONFIG_OF. Link: https://lore.kernel.org/r/202201041700.01KZEzhb-lkp@intel.com Fixes: 92beba6f5671 ("perf/smmuv3: Add devicetree support") Reported-by: kernel test robot Signed-off-by: Will Deacon --- diff --git a/drivers/perf/arm_smmuv3_pmu.c b/drivers/perf/arm_smmuv3_pmu.c index 598d6978280d8..1ae19f7301b29 100644 --- a/drivers/perf/arm_smmuv3_pmu.c +++ b/drivers/perf/arm_smmuv3_pmu.c @@ -939,11 +939,13 @@ static void smmu_pmu_shutdown(struct platform_device *pdev) smmu_pmu_disable(&smmu_pmu->pmu); } +#ifdef CONFIG_OF static const struct of_device_id smmu_pmu_of_match[] = { { .compatible = "arm,smmu-v3-pmcg" }, {} }; MODULE_DEVICE_TABLE(of, smmu_pmu_of_match); +#endif static struct platform_driver smmu_pmu_driver = { .driver = {