public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Omar Ramirez Luna <omar.ramirez@ti.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: linux-omap <linux-omap@vger.kernel.org>
Subject: Re: [PATCH] dspbridge: Simplify Atoi() method
Date: Wed, 10 Feb 2010 09:55:52 -0600	[thread overview]
Message-ID: <4B72D708.309@ti.com> (raw)
In-Reply-To: <5ec8ebd51002092359v740d4e6asb0b6bab0d069c687@mail.gmail.com>

On 2/10/2010 1:59 AM, Andy Shevchenko wrote:
> On Wed, Feb 10, 2010 at 4:02 AM, Omar Ramirez Luna<omar.ramirez@ti.com>  wrote:
>>> Try to use simple_strtol() kernel native method instead.
>> strtol or strtoul?
> I don't know for sure, see below.

sorry, i meant: here it says simple_strtol but the code says simple_strtoul

>
>>> However, there are opened questions:
>>>   - why type of Atoi() is s32 if the sign is used only to detect base?
> This is the question about l vs ul.

agree, IMO this should be ul, I haven't reviewed all the places where 
Atoi is used but the ones I have seen use it as ul

about the sign: I haven't seen any value with '+' or '-' prefix so with 
this patch the decision to identify as base10 is left to 
simple_guess_base inside strtoul

if value strings had '0x' instead of ending 'H' for hex the whole Atoi 
could be replaced, i guess this would also allow to use strict_strtoul 
and avoid a checkpatch warning :(

- omar


      reply	other threads:[~2010-02-10 15:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-03 10:14 [PATCH] dspbridge: Simplify Atoi() method Andy Shevchenko
2010-02-10  2:02 ` Omar Ramirez Luna
2010-02-10  7:58   ` [PATCH] dspbridge: Simplify Atoi() method (v2) Andy Shevchenko
2010-02-16 23:49     ` Omar Ramirez Luna
2010-02-10  7:59   ` [PATCH] dspbridge: Simplify Atoi() method Andy Shevchenko
2010-02-10 15:55     ` Omar Ramirez Luna [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=4B72D708.309@ti.com \
    --to=omar.ramirez@ti.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=linux-omap@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