mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gary R Hook <gary.hook@amd.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "iommu@lists.linux-foundation.org"
	<iommu@lists.linux-foundation.org>,
	Joerg Roedel <joro@8bytes.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 5/5] iommu/amd - Add a debugfs entry to specify a IOMMU device table entry
Date: Wed, 14 Mar 2018 10:24:45 -0500	[thread overview]
Message-ID: <5c84192d-8110-b06f-740d-723cd3099a42@amd.com> (raw)
In-Reply-To: <CAHp75VcuYamhrEu=B1zeFpz6s1vGfZaMyonYK6p_Y_EJF4=4Ng@mail.gmail.com>

On 03/13/2018 03:56 PM, Andy Shevchenko wrote:
> 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 ...
> 
> 

Gotcha. Fixed.

Thanks,
Gary

      reply	other threads:[~2018-03-14 15:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-09  0:50 [PATCH v2 0/5] Add debugfs info for the AMD IOMMU Gary R Hook
2018-03-09  0:50 ` [PATCH v2 1/5] iommu/amd - Add debugfs support Gary R Hook
2018-03-13 17:16   ` Andy Shevchenko
2018-03-13 18:54     ` Gary R Hook
2018-03-13 20:23       ` Andy Shevchenko
2018-03-14 15:24         ` Gary R Hook
2018-03-14 15:29           ` Andy Shevchenko
2018-03-14 22:23             ` Gary R Hook
2018-03-09  0:50 ` [PATCH v2 2/5] iommu/amd - Add a 'verbose' switch for IOMMU debugfs Gary R Hook
2018-03-09  0:51 ` [PATCH v2 3/5] iommu/amd - Add a README variable for the " Gary R Hook
2018-03-09  0:51 ` [PATCH v2 4/5] iommu/amd - Expose the active IOMMU device table entries Gary R Hook
2018-03-09  0:51 ` [PATCH v2 5/5] iommu/amd - Add a debugfs entry to specify a IOMMU device table entry Gary R Hook
2018-03-13 17:20   ` Andy Shevchenko
2018-03-13 18:54     ` Gary R Hook
2018-03-13 20:56       ` Andy Shevchenko
2018-03-14 15:24         ` Gary R Hook [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5c84192d-8110-b06f-740d-723cd3099a42@amd.com \
    --to=gary.hook@amd.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®