linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] iommu/amd: Fix compiler warning in copy_device_table()
@ 2017-08-18 22:40 Joerg Roedel
  2017-08-18 22:40 ` [PATCH 2/2] iommu/amd: Fix section mismatch warning Joerg Roedel
  2017-08-19  1:16 ` [PATCH 1/2] iommu/amd: Fix compiler warning in copy_device_table() Baoquan He
  0 siblings, 2 replies; 3+ messages in thread
From: Joerg Roedel @ 2017-08-18 22:40 UTC (permalink / raw)
  To: iommu; +Cc: Baoquan He, linux-kernel, Joerg Roedel

From: Joerg Roedel <jroedel@suse.de>

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
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
 drivers/iommu/amd_iommu_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index c7d0325..f2023cd 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -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;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] iommu/amd: Fix section mismatch warning
  2017-08-18 22:40 [PATCH 1/2] iommu/amd: Fix compiler warning in copy_device_table() Joerg Roedel
@ 2017-08-18 22:40 ` Joerg Roedel
  2017-08-19  1:16 ` [PATCH 1/2] iommu/amd: Fix compiler warning in copy_device_table() Baoquan He
  1 sibling, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2017-08-18 22:40 UTC (permalink / raw)
  To: iommu; +Cc: Baoquan He, linux-kernel, Joerg Roedel

From: Joerg Roedel <jroedel@suse.de>

The variable amd_iommu_pre_enabled is used in non-init
code-paths, so remove the __initdata annotation.

Fixes: 3ac3e5ee5ed56 ('iommu/amd: Copy old trans table from old kernel')
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
 drivers/iommu/amd_iommu_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index f2023cd..ff8887a 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -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)
 {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] iommu/amd: Fix compiler warning in copy_device_table()
  2017-08-18 22:40 [PATCH 1/2] iommu/amd: Fix compiler warning in copy_device_table() Joerg Roedel
  2017-08-18 22:40 ` [PATCH 2/2] iommu/amd: Fix section mismatch warning Joerg Roedel
@ 2017-08-19  1:16 ` Baoquan He
  1 sibling, 0 replies; 3+ messages in thread
From: Baoquan He @ 2017-08-19  1:16 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: iommu, linux-kernel, Joerg Roedel

On 08/19/17 at 12:40am, Joerg Roedel wrote:
> From: Joerg Roedel <jroedel@suse.de>
> 
> 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
> Signed-off-by: Joerg Roedel <jroedel@suse.de>

Thanks for fixing these code bugs, Joerg.

Ack the series!

Acked-by: Baoquan He <bhe@redhat.com>

> ---
>  drivers/iommu/amd_iommu_init.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
> index c7d0325..f2023cd 100644
> --- a/drivers/iommu/amd_iommu_init.c
> +++ b/drivers/iommu/amd_iommu_init.c
> @@ -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;
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-19  1:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-18 22:40 [PATCH 1/2] iommu/amd: Fix compiler warning in copy_device_table() Joerg Roedel
2017-08-18 22:40 ` [PATCH 2/2] iommu/amd: Fix section mismatch warning Joerg Roedel
2017-08-19  1:16 ` [PATCH 1/2] iommu/amd: Fix compiler warning in copy_device_table() Baoquan He

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).