lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VcuYamhrEu=B1zeFpz6s1vGfZaMyonYK6p_Y_EJF4=4Ng@mail.gmail.com>
Date:   Tue, 13 Mar 2018 22:56:30 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Gary R Hook <gary.hook@....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 Tue, Mar 13, 2018 at 8:54 PM, Gary R Hook <gary.hook@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ