iommu/amd: Fix compiler warning in copy_device_table()
Joerg Roedel
maintainerPATCH 1/2 iommu/amd: Fix compiler warning in copy_device_table()
From: Joerg Roedel <[email protected]>
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.
--- drivers/iommu/amd_iommu_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/amd_iommu_init.c +1 -1
@@ -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;
Signature · 1 line
2.7.4
Joerg Roedel
maintainerPATCH 2/2 iommu/amd: Fix section mismatch warning
From: Joerg Roedel <[email protected]>
The variable amd_iommu_pre_enabled is used in non-init code-paths, so remove the __initdata annotation.
--- drivers/iommu/amd_iommu_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/amd_iommu_init.c +1 -1
@@ -264,7 +264,7 @@ static int amd_iommu_enable_interrupts(void);static int __init iommu_go_to_state (enum iommu_init_state state);static void init_device_table_dma (void ); -static bool __initdata amd_iommu_pre_enabled = true; +static bool amd_iommu_pre_enabled = true;bool translation_pre_enabled (struct amd_iommu *iommu) {
Signature · 1 line
2.7.4
Quoted 9 lines · Joerg Roedel
From: Joerg Roedel <[email protected]>
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 robotSigned-off-by Joerg Roedel <[email protected]>
Thanks for fixing these code bugs, Joerg.
Ack the series!
Quoted 20 lines
--- drivers/iommu/amd_iommu_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iommu/amd_iommu_init.c +1
-1@@ -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;Signature · 1 line
2.7.4