public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: video: pwc: Use kernel's simple_strtol()
@ 2009-09-16 11:42 Andy Shevchenko
  2009-09-16 12:05 ` Andrey Panin
  0 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2009-09-16 11:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andy Shevchenko

From: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>

Change own implementation of atoi() by simple_strtol(x, NULL, 10).

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);
 }
 
 
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-09-16 15:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-16 11:42 [PATCH] media: video: pwc: Use kernel's simple_strtol() Andy Shevchenko
2009-09-16 12:05 ` Andrey Panin
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox