From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH 5/6] iommu/amd: Add support for non-pci devices Date: Fri, 8 Jan 2016 13:18:56 +0100 Message-ID: <20160108121855.GU18805@8bytes.org> References: <1451988444-4694-1-git-send-email-vincent.wan@amd.com> <1451988444-4694-6-git-send-email-vincent.wan@amd.com> <20160107120422.GB19149@8bytes.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Wan ZongShun Cc: Wan Zongshun , linux-kernel , iommu@lists.linux-foundation.org, Ray Huang , Borislav Petkov , ken.xue@amd.com, vw@iommu.org List-Id: iommu@lists.linux-foundation.org On Fri, Jan 08, 2016 at 11:15:37AM +0800, Wan ZongShun wrote: > Please see the following function, since I judge this > 'get_acpihid_device_id(dev, NULL) < 0' in the front of > 'get_device_id', so your concern should not exist. I have already > filtered the negative situation in check_device firstly, do you think > it is ok? > > > static bool check_device(struct device *dev) > { > u16 devid; > ...... > > /* No PCI device */ > if (!dev_is_pci(dev) && (get_acpihid_device_id(dev, NULL) < 0)) > return false; > > devid = get_device_id(dev); That is true for this case, but the other call-sites of get_device_id() still have to care about a potential negative return value, right? Joerg