[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230530092503.152926-2-yanfei.xu@intel.com>
Date: Tue, 30 May 2023 17:25:02 +0800
From: Yanfei Xu <yanfei.xu@...el.com>
To: dwmw2@...radead.org, baolu.lu@...ux.intel.com, joro@...tes.org,
will@...nel.org, robin.murphy@....com
Cc: iommu@...ts.linux.dev, linux-kernel@...r.kernel.org,
yanfei.xu@...el.com
Subject: [PATCH 1/2] iommu/vt-d: Remove the dead code in init_iommu_hw()
After 'commit 2a41ccee2fdc ("iommu/vt-d: Change
iommu_enable/disable_translation to return void")', init_iommu_hw() only
returns 0. If statement for return value of this function is meaningless.
Hence change init_iommu_hw() to return viod and remove the dead code of
if statement in init_iommu_hw()
Signed-off-by: Yanfei Xu <yanfei.xu@...el.com>
---
drivers/iommu/intel/iommu.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index 8096273b034c..e98f1b122b49 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -2963,7 +2963,7 @@ static void __init init_no_remapping_devices(void)
}
#ifdef CONFIG_SUSPEND
-static int init_iommu_hw(void)
+static void init_iommu_hw(void)
{
struct dmar_drhd_unit *drhd;
struct intel_iommu *iommu = NULL;
@@ -2988,8 +2988,6 @@ static int init_iommu_hw(void)
iommu_enable_translation(iommu);
iommu_disable_protect_mem_regions(iommu);
}
-
- return 0;
}
static void iommu_flush_all(void)
@@ -3051,13 +3049,7 @@ static void iommu_resume(void)
struct intel_iommu *iommu = NULL;
unsigned long flag;
- if (init_iommu_hw()) {
- if (force_on)
- panic("tboot: IOMMU setup failed, DMAR can not resume!\n");
- else
- WARN(1, "IOMMU setup failed, DMAR can not resume!\n");
- return;
- }
+ init_iommu_hw();
for_each_active_iommu(iommu, drhd) {
--
2.34.1
Powered by blists - more mailing lists