lkml.org 
[lkml]   [2018]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 5/5] iommu/amd - Add a debugfs entry to specify a IOMMU device table entry
On Tue, Mar 13, 2018 at 8:54 PM, Gary R Hook <gary.hook@amd.com> wrote:
> On 03/13/2018 12:20 PM, Andy Shevchenko wrote:

>>> + } 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.

sscanf() has an enormous overhead for cases like this.

simple

ret = kstrtoint();
if (ret)
... do error handling ...


--
With Best Regards,
Andy Shevchenko

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