lkml.org 
[lkml]   [2018]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 5/5] iommu/amd - Add a debugfs entry to specify a IOMMU device table entry
From
Date
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.

\
 
 \ /
  Last update: 2018-03-13 19:55    [W:0.084 / U:0.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site