Skip to contentSkip to conversation

staging:panel: Fix cursor positioning escapes

PATCH In review Zoltan Kelemen 1 participant 1 message Jun 28, 2012 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 staging:panel: Fix cursor positioning escapes

Patch for fixing bug in cursor position escape handling. The bug was introduced when simple_strtoul was converted to kstrtoul without taking into account that the end pointer is used to continue the parsing. Reverted the code back to simple_strtoul.

This patch depends on patch 2 and should therefore be applied after it.

----

drivers/staging/panel/panel.c +6 -4
diff -ru linux-next/drivers/staging/panel/panel.c panel-patch3/drivers/staging/panel/panel.c
@@ -1228,14 +1228,16 @@
 			break;
 
 		while (*esc) {
+			char *endp;
+
 			if (*esc == 'x') {
 				esc++;
-				if (kstrtoul(esc, 10, &lcd_addr_x) < 0)
-					break;
+				lcd_addr_x = simple_strtoul(esc, &endp, 10);
+				esc = endp;
 			} else if (*esc == 'y') {
 				esc++;
-				if (kstrtoul(esc, 10, &lcd_addr_y) < 0)
-					break;
+				lcd_addr_y = simple_strtoul(esc, &endp, 10);
+				esc = endp;
 			} else
 				break;
 		}