Blob Blame History Raw
From: Joerg Roedel <jroedel@suse.de>
Date: Sat, 19 Aug 2017 00:28:02 +0200
Subject: iommu/amd: Fix compiler warning in copy_device_table()
Patch-mainline: v4.14-rc1
Git-commit: ae162efbf2870c326e06b4f905423fb888f9cd2a
References: bsc#1043261

This was reported by the kbuild bot. The condition in which
entry would be used uninitialized can not happen, because
when there is no iommu this function would never be called.
But its no fast-path, so fix the warning anyway.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Acked-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
 drivers/iommu/amd_iommu_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -855,7 +855,7 @@ static int get_dev_entry_bit(u16 devid,
 
 static bool copy_device_table(void)
 {
-	u64 int_ctl, int_tab_len, entry, last_entry = 0;
+	u64 int_ctl, int_tab_len, entry = 0, last_entry = 0;
 	struct dev_table_entry *old_devtb = NULL;
 	u32 lo, hi, devid, old_devtb_size;
 	phys_addr_t old_devtb_phys;