Skip to content

Commit 527a7f5

Browse files
committed
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/[email protected] Fixes: 3f7be43 ("perf/smmuv3: Add devicetree support") Reported-by: kernel test robot <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent 1609c22 commit 527a7f5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/perf/arm_smmuv3_pmu.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,11 +939,13 @@ static void smmu_pmu_shutdown(struct platform_device *pdev)
939939
smmu_pmu_disable(&smmu_pmu->pmu);
940940
}
941941

942+
#ifdef CONFIG_OF
942943
static const struct of_device_id smmu_pmu_of_match[] = {
943944
{ .compatible = "arm,smmu-v3-pmcg" },
944945
{}
945946
};
946947
MODULE_DEVICE_TABLE(of, smmu_pmu_of_match);
948+
#endif
947949

948950
static struct platform_driver smmu_pmu_driver = {
949951
.driver = {

0 commit comments

Comments
 (0)