From: "Andrey Panin" <pazke@centrinvest.ru>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: linux-kernel@vger.kernel.org,
Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Subject: Re: [PATCH] media: video: pwc: Use kernel's simple_strtol()
Date: Wed, 16 Sep 2009 16:05:29 +0400 [thread overview]
Message-ID: <20090916120529.GB18050@centrinvest.ru> (raw)
In-Reply-To: <1253101347-25038-1-git-send-email-andy.shevchenko@gmail.com>
On 259, 09 16, 2009 at 02:42:27PM +0300, Andy Shevchenko wrote:
> From: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
>
> Change own implementation of atoi() by simple_strtol(x, NULL, 10).
Why did you keep the wrapper itself then ?
> Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
> ---
> drivers/media/video/pwc/pwc-if.c | 13 +++----------
> 1 files changed, 3 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c
> index f976df4..cb995c6 100644
> --- a/drivers/media/video/pwc/pwc-if.c
> +++ b/drivers/media/video/pwc/pwc-if.c
> @@ -68,6 +68,7 @@
> #endif
> #include <linux/vmalloc.h>
> #include <asm/io.h>
> +#include <linux/kernel.h> /* simple_strtol() */
>
> #include "pwc.h"
> #include "pwc-kiara.h"
> @@ -1916,17 +1917,9 @@ disconnect_out:
> unlock_kernel();
> }
>
> -/* *grunt* We have to do atoi ourselves :-( */
> -static int pwc_atoi(const char *s)
> +static inline int pwc_atoi(const char *s)
> {
> - int k = 0;
> -
> - k = 0;
> - while (*s != '\0' && *s >= '0' && *s <= '9') {
> - k = 10 * k + (*s - '0');
> - s++;
> - }
> - return k;
> + return (int)simple_strtol(s, NULL, 10);
> }
next prev parent reply other threads:[~2009-09-16 12:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-16 11:42 Andy Shevchenko
2009-09-16 12:05 ` Andrey Panin [this message]
2009-09-16 12:16 ` Andy Shevchenko
2009-09-16 12:26 ` [PATCH v2] " Andy Shevchenko
2009-09-16 12:43 ` Pekka Enberg
2009-09-16 13:53 ` [PATCH v3] " Andy Shevchenko
2009-09-16 15:34 ` Pekka Enberg
2009-09-16 13:54 ` [PATCH v2] " Andy Shevchenko
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=20090916120529.GB18050@centrinvest.ru \
--to=pazke@centrinvest.ru \
--cc=andy.shevchenko@gmail.com \
--cc=ext-andriy.shevchenko@nokia.com \
--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®