From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754874AbcAHMTB (ORCPT ); Fri, 8 Jan 2016 07:19:01 -0500 Received: from 8bytes.org ([81.169.241.247]:60323 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752795AbcAHMTA (ORCPT ); Fri, 8 Jan 2016 07:19:00 -0500 Date: Fri, 8 Jan 2016 13:18:56 +0100 From: Joerg Roedel To: Wan ZongShun Cc: Wan Zongshun , linux-kernel , iommu@lists.linux-foundation.org, Ray Huang , Borislav Petkov , ken.xue@amd.com, vw@iommu.org Subject: Re: [PATCH 5/6] iommu/amd: Add support for non-pci devices 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 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.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