Commit d85170ed authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Greg Kroah-Hartman

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: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 47c7157f
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#include <linux/fcntl.h> #include <linux/fcntl.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/parport.h> #include <linux/parport.h>
#include <linux/version.h> #include <linux/version.h>
...@@ -1179,22 +1180,16 @@ static inline int handle_lcd_special_code(void) ...@@ -1179,22 +1180,16 @@ static inline int handle_lcd_special_code(void)
break; break;
while (*esc) { while (*esc) {
char *endp;
if (*esc == 'x') { if (*esc == 'x') {
esc++; esc++;
lcd_addr_x = 0; lcd_addr_x = simple_strtoul(esc, &endp, 10);
while (isdigit(*esc)) { esc = endp;
lcd_addr_x = lcd_addr_x * 10 +
(*esc - '0');
esc++;
}
} else if (*esc == 'y') { } else if (*esc == 'y') {
esc++; esc++;
lcd_addr_y = 0; lcd_addr_y = simple_strtoul(esc, &endp, 10);
while (isdigit(*esc)) { esc = endp;
lcd_addr_y = lcd_addr_y * 10 +
(*esc - '0');
esc++;
}
} else } else
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment