lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1c9daf151cb12e4267a74236791eeda9b600c240.1279817399.git.andy.shevchenko@gmail.com>
Date:	Thu, 22 Jul 2010 19:57:08 +0300
From:	Andy Shevchenko <andy.shevchenko@...il.com>
To:	linux-kernel@...r.kernel.org, Greg Kroah-Hartman <gregkh@...e.de>,
	devel@...verdev.osuosl.org
Cc:	Andy Shevchenko <andy.shevchenko@...il.com>
Subject: [PATCH 2/5] staging: panel: change own pieces of code by strtoul()

We have nice method simple_strtoul() to convert string to numbers which
could be used here.

Signed-off-by: Andy Shevchenko <andy.shevchenko@...il.com>
---
 drivers/staging/panel/panel.c |   19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
index 8bd7182..3e07e41 100644
--- a/drivers/staging/panel/panel.c
+++ b/drivers/staging/panel/panel.c
@@ -48,6 +48,7 @@
 #include <linux/fcntl.h>
 #include <linux/init.h>
 #include <linux/delay.h>
+#include <linux/kernel.h>
 #include <linux/ctype.h>
 #include <linux/parport.h>
 #include <linux/version.h>
@@ -1179,22 +1180,16 @@ static inline int handle_lcd_special_code(void)
 			break;
 
 		while (*esc) {
+			char *endp;
+
 			if (*esc == 'x') {
 				esc++;
-				lcd_addr_x = 0;
-				while (isdigit(*esc)) {
-					lcd_addr_x = lcd_addr_x * 10 +
-						     (*esc - '0');
-					esc++;
-				}
+				lcd_addr_x = simple_strtoul(esc, &endp, 10);
+				esc = endp;
 			} else if (*esc == 'y') {
 				esc++;
-				lcd_addr_y = 0;
-				while (isdigit(*esc)) {
-					lcd_addr_y = lcd_addr_y * 10 +
-						     (*esc - '0');
-					esc++;
-				}
+				lcd_addr_y = simple_strtoul(esc, &endp, 10);
+				esc = endp;
 			} else
 				break;
 		}
-- 
1.7.1.1

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ