Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758519AbZIPMFd (ORCPT ); Wed, 16 Sep 2009 08:05:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757678AbZIPMFc (ORCPT ); Wed, 16 Sep 2009 08:05:32 -0400 Received: from centrinvest.ru ([94.25.115.130]:58448 "EHLO centrinvest.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757622AbZIPMF3 (ORCPT ); Wed, 16 Sep 2009 08:05:29 -0400 From: "Andrey Panin" Date: Wed, 16 Sep 2009 16:05:29 +0400 To: Andy Shevchenko Cc: linux-kernel@vger.kernel.org, Andy Shevchenko Subject: Re: [PATCH] media: video: pwc: Use kernel's simple_strtol() Message-ID: <20090916120529.GB18050@centrinvest.ru> Mail-Followup-To: Andy Shevchenko , linux-kernel@vger.kernel.org, Andy Shevchenko References: <1253101347-25038-1-git-send-email-andy.shevchenko@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1253101347-25038-1-git-send-email-andy.shevchenko@gmail.com> X-Uname: Linux 2.6.26-1-amd64 x86_64 User-Agent: Mutt/1.5.20 (2009-06-14) X-Anti-Virus: kav4lms: continue Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1452 Lines: 48 On 259, 09 16, 2009 at 02:42:27PM +0300, Andy Shevchenko wrote: > From: Andy Shevchenko > > Change own implementation of atoi() by simple_strtol(x, NULL, 10). Why did you keep the wrapper itself then ? > Signed-off-by: Andy Shevchenko > --- > 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 > #include > +#include /* 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); > } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/