Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1715489 > unrolled thread

[PATCH 1/2] iommu/amd: Fix compiler warning in copy_device_table()

Started byJoerg Roedel <joro@8bytes.org>
First post2017-08-19 00:50 +0200
Last post2017-08-19 03:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/2] iommu/amd: Fix compiler warning in copy_device_table() Joerg Roedel <joro@8bytes.org> - 2017-08-19 00:50 +0200
    Re: [PATCH 1/2] iommu/amd: Fix compiler warning in  copy_device_table() Baoquan He <bhe@redhat.com> - 2017-08-19 03:20 +0200

#1715489 — [PATCH 1/2] iommu/amd: Fix compiler warning in copy_device_table()

FromJoerg Roedel <joro@8bytes.org>
Date2017-08-19 00:50 +0200
Subject[PATCH 1/2] iommu/amd: Fix compiler warning in copy_device_table()
Message-ID<ufYfv-1xu-3@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1715549 — Re: [PATCH 1/2] iommu/amd: Fix compiler warning in copy_device_table()

FromBaoquan He <bhe@redhat.com>
Date2017-08-19 03:20 +0200
SubjectRe: [PATCH 1/2] iommu/amd: Fix compiler warning in copy_device_table()
Message-ID<ug0AG-35E-7@gated-at.bofh.it>
In reply to#1715489
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
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web