iommu/amd: Fix compiler warning in copy_device_table()
authorJoerg Roedel <jroedel@suse.de>
Fri, 18 Aug 2017 22:28:02 +0000 (00:28 +0200)
committerJoerg Roedel <jroedel@suse.de>
Sat, 19 Aug 2017 08:33:42 +0000 (10:33 +0200)
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

index c7d03251c80a42ac24112bcaa5cde64cc626cb6c..f2023cd08ef79e2477bc516f3b7397957c6ad6b7 100644 (file)
@@ -854,7 +854,7 @@ static int get_dev_entry_bit(u16 devid, u8 bit)
 
 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;