]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/amd: Fix compile warning in init code
authorJoerg Roedel <jroedel@suse.de>
Fri, 29 Jul 2022 10:04:32 +0000 (12:04 +0200)
committerJoerg Roedel <jroedel@suse.de>
Fri, 29 Jul 2022 10:06:14 +0000 (12:06 +0200)
commit2df7dc98a8bd678f18b2a95c267820e3822a05da
tree6cc12b3444e58e31460d0eae264ee0235c2343d2
parentde056e82f4fbc34ffd4a0afc10d0fc65a857b39c
iommu/amd: Fix compile warning in init code

A recent commit introduced these compile warnings:

  CC      drivers/iommu/amd/init.o
drivers/iommu/amd/init.c:938:12: error: ‘iommu_init_ga_log’ defined but not used [-Werror=unused-function]
  938 | static int iommu_init_ga_log(struct amd_iommu *iommu)
      |            ^~~~~~~~~~~~~~~~~
drivers/iommu/amd/init.c:902:12: error: ‘iommu_ga_log_enable’ defined but not used [-Werror=unused-function]
  902 | static int iommu_ga_log_enable(struct amd_iommu *iommu)
      |            ^~~~~~~~~~~~~~~~~~~

The warnings appear because both functions are defined when IRQ
remapping is not enabled, but only used when IRQ remapping is enabled.

Fix it by only defining the functions when IRQ remapping is enabled.

Fixes: 570d8cf7c122 ("iommu/amd: Simplify and Consolidate Virtual APIC (AVIC) Enablement")
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Link: https://lore.kernel.org/r/20220729100432.22474-1-joro@8bytes.org
drivers/iommu/amd/init.c