mirror of
https://github.com/torvalds/linux.git
synced 2026-11-30 02:23:05 +00:00
drivers/iommu/intel-iommu.c: fix variable 'iommu' set but not used
Commit cf04eee8bf ("iommu/vt-d: Include ACPI devices in iommu=pt")
added for_each_active_iommu() in iommu_prepare_static_identity_mapping()
but never used the each element, i.e, "drhd->iommu".
drivers/iommu/intel-iommu.c: In function
'iommu_prepare_static_identity_mapping':
drivers/iommu/intel-iommu.c:3037:22: warning: variable 'iommu' set but
not used [-Wunused-but-set-variable]
struct intel_iommu *iommu;
Fixed the warning by appending a compiler attribute __maybe_unused for it.
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Qian Cai <[email protected]>
Suggested-by: Andrew Morton <[email protected]>
Cc: Joerg Roedel <[email protected]>
Cc: David Woodhouse <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
@@ -3034,7 +3034,8 @@ static int __init iommu_prepare_static_identity_mapping(int hw)
|
||||
{
|
||||
struct pci_dev *pdev = NULL;
|
||||
struct dmar_drhd_unit *drhd;
|
||||
struct intel_iommu *iommu;
|
||||
/* To avoid a -Wunused-but-set-variable warning. */
|
||||
struct intel_iommu *iommu __maybe_unused;
|
||||
struct device *dev;
|
||||
int i;
|
||||
int ret = 0;
|
||||
|
||||
Reference in New Issue
Block a user