All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Mans Rullgard <mans@mansr.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Petr Mladek <pmladek@suse.com>
Subject: Re: [PATCH v2 1/2] kernel.h: Update comment about simple_strto<foo>() functions
Date: Wed, 3 Jul 2019 17:37:28 +0300	[thread overview]
Message-ID: <20190703143728.GS9224@smile.fi.intel.com> (raw)
In-Reply-To: <CAMuHMdWm7ftYNVQfjLdPxvzZQLa6mWQvjE8vGo98-QOGeyjZFQ@mail.gmail.com>

On Wed, Jun 26, 2019 at 01:00:45PM +0200, Geert Uytterhoeven wrote:
> Hi Andy,
> 
> On Wed, Jun 26, 2019 at 11:39 AM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > There were discussions in the past about use cases for
> > simple_strto<foo>() functions and in some rare cases they have a benefit
> > on kstrto<foo>() ones.
> 
> over

Will fix.

> > Update a comment to reduce confusing about special use cases.
> 
> confusion

Will fix.

> > Suggested-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> > --- a/include/linux/kernel.h
> > +++ b/include/linux/kernel.h
> 
> > @@ -437,7 +435,15 @@ static inline int __must_check kstrtos32_from_user(const char __user *s, size_t
> >         return kstrtoint_from_user(s, count, base, res);
> >  }
> >
> > -/* Obsolete, do not use.  Use kstrto<foo> instead */
> > +/*
> > + * Use kstrto<foo> instead.
> > + *
> > + * NOTE: The simple_strto<foo> does not check for overflow and,
> > + *      depending on the input, may give interesting results.
> > + *
> > + * Use these functions if and only if the code will need in place
> > + * conversion and otherwise looks very ugly. Keep in mind above caveat.
> 
> What do you mean by "in place conversion"?
> The input buffer is const, and not modified by the callee.
> Do you mean that these functions do not require NUL termination (just
> after the number), and the characters making up the number don't have to
> be copied to a separate buffer to make them NUL-terminated?

The second one, could you propose better wording for that?

> > + */
> >
> >  extern unsigned long simple_strtoul(const char *,char **,unsigned int);
> >  extern long simple_strtol(const char *,char **,unsigned int);
> 
> Yeah, they're still very useful.

Thanks for review.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2019-07-03 14:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-26  9:39 [PATCH v2 1/2] kernel.h: Update comment about simple_strto<foo>() functions Andy Shevchenko
2019-06-26  9:39 ` [PATCH v2 2/2] auxdisplay: charlcd: Deduplicate simple_strtoul() Andy Shevchenko
2019-06-26 11:00 ` [PATCH v2 1/2] kernel.h: Update comment about simple_strto<foo>() functions Geert Uytterhoeven
2019-07-03 14:37   ` Andy Shevchenko [this message]
2019-07-04  7:14     ` Geert Uytterhoeven

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=20190703143728.GS9224@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mans@mansr.com \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=pmladek@suse.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.