On 03/13/2018 12:20 PM, Andy Shevchenko wrote:
+ 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.
But until then.... ;-)
+ if (strnchr(obuf, OBUFLEN, ':')) + {Style
D'oh!
+ } else if (obuf[0] == '0' && obuf[1] == 'x') { + n = sscanf(obuf, "%x", &amd_iommu_devid); + } else { + n = sscanf(obuf, "%d", &amd_iommu_devid); + }kstrtoint() ?
I see various mechanisms for this sort of thing, and simply chose one. Am happy to use whatever is preferred. _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
