[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1253101347-25038-1-git-send-email-andy.shevchenko@gmail.com>
Date: Wed, 16 Sep 2009 14:42:27 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: linux-kernel@...r.kernel.org
Cc: Andy Shevchenko <ext-andriy.shevchenko@...ia.com>
Subject: [PATCH] media: video: pwc: Use kernel's simple_strtol()
From: Andy Shevchenko <ext-andriy.shevchenko@...ia.com>
Change own implementation of atoi() by simple_strtol(x, NULL, 10).
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@...ia.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists