Skip to content

Commit

Permalink
staging: panel: change own pieces of code by strtoul()
Browse files Browse the repository at this point in the history
We have nice method simple_strtoul() to convert string to numbers which
could be used here.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Andy Shevchenko authored and Greg Kroah-Hartman committed Jul 22, 2010
1 parent 47c7157 commit d85170e
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions drivers/staging/panel/panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit d85170e

Please sign in to comment.