[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3969f155-c3bf-44c5-d056-825e71d42152@amd.com>
Date: Tue, 13 Mar 2018 13:54:15 -0500
From: Gary R Hook <gary.hook@....com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: "iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>,
Joerg Roedel <joro@...tes.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 5/5] iommu/amd - Add a debugfs entry to specify a IOMMU
device table entry
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.
Powered by blists - more mailing lists