Commit 803f6c4
iommu/amd: Fix compile warning in init code
BugLink: https://bugs.launchpad.net/bugs/2080378
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: c5e1a1e ("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
(backported from commit be280ea)
[ghadi-rahme: Had to adjust the context due to missing commits]
Signed-off-by: Ghadi Elie Rahme <ghadi.rahme@canonical.com>
Acked-by: Guoqing Jiang <guoqing.jiang@canonical.com>
Acked-by: Ivan Hu <ivan.hu@canonical.com>
Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>1 parent 36e6afc commit 803f6c4
1 file changed
+3
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
816 | 816 | | |
817 | 817 | | |
818 | 818 | | |
| 819 | + | |
819 | 820 | | |
820 | 821 | | |
821 | | - | |
822 | 822 | | |
823 | 823 | | |
824 | 824 | | |
| |||
848 | 848 | | |
849 | 849 | | |
850 | 850 | | |
851 | | - | |
| 851 | + | |
852 | 852 | | |
853 | 853 | | |
854 | 854 | | |
855 | 855 | | |
856 | 856 | | |
857 | | - | |
858 | 857 | | |
859 | 858 | | |
860 | 859 | | |
| |||
872 | 871 | | |
873 | 872 | | |
874 | 873 | | |
875 | | - | |
876 | | - | |
877 | | - | |
878 | 874 | | |
| 875 | + | |
879 | 876 | | |
880 | 877 | | |
881 | 878 | | |
| |||
0 commit comments