From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751597AbdHSBQF (ORCPT ); Fri, 18 Aug 2017 21:16:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35440 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751060AbdHSBQE (ORCPT ); Fri, 18 Aug 2017 21:16:04 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9B05483F3F Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=bhe@redhat.com Date: Sat, 19 Aug 2017 09:16:00 +0800 From: Baoquan He To: Joerg Roedel Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Joerg Roedel Subject: Re: [PATCH 1/2] iommu/amd: Fix compiler warning in copy_device_table() Message-ID: <20170819011600.GC20615@x1> References: <1503096026-6851-1-git-send-email-joro@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1503096026-6851-1-git-send-email-joro@8bytes.org> User-Agent: Mutt/1.7.0 (2016-08-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Sat, 19 Aug 2017 01:16:04 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/19/17 at 12:40am, Joerg Roedel wrote: > From: Joerg Roedel > > 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 Thanks for fixing these code bugs, Joerg. Ack the series! Acked-by: Baoquan He > --- > 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 >