On Fri, Mar 9, 2018 at 2:51 AM, Gary R Hook <gary.h...@amd.com> wrote:
> Initially (at boot) the device table values dumped are all of the
> active devices.  Add a devid debugfs file to allow the user to select a
> single device table entry to dump (active or not). Let any devid value
> greater than the maximum allowable PCI ID (0xFFFF) restore the
> behavior to that effective at boot.

> +               oboff += OSCNPRINTF("%02x:%02x:%x (%u / %04x)\n",
> +                                   PCI_BUS_NUM(amd_iommu_devid),
> +                                   PCI_SLOT(amd_iommu_devid),
> +                                   PCI_FUNC(amd_iommu_devid),

Perhaps at some point we will have an extension to %p to print PCI BDFs.

> +       if (strnchr(obuf, OBUFLEN, ':'))
> +       {

Style

> +       } else if (obuf[0] == '0' && obuf[1] == 'x') {
> +               n = sscanf(obuf, "%x", &amd_iommu_devid);
> +       } else {
> +               n = sscanf(obuf, "%d", &amd_iommu_devid);
> +       }

kstrtoint() ?

-- 
With Best Regards,
Andy Shevchenko
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to