Re: [PATCH 5/6] iommu/amd: Add support for non-pci devices

From: Joerg Roedel
Date: Fri Jan 08 2016 - 07:19:05 EST


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