Skip to contentSkip to conversation

staging: panel: Fixed checkpatch warning about simple_strtoul()

PATCH In review Pelle Windestam 3 participants 4 messages Aug 30, 2011 – Oct 11, 2011 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: panel: Fixed checkpatch warning about simple_strtoul()

Fixed the checkpatch warning about sing simple_strtoul instead of kstrtoul() in panel.c.

---
 drivers/staging/panel/panel.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
drivers/staging/panel/panel.c +4 -6
index b303b7e..4683d5f 100644
@@ -1179,16 +1179,14 @@ static inline int handle_lcd_special_code(void)
 			break;
 
 		while (*esc) {
-			char *endp;
-
 			if (*esc == 'x') {
 				esc++;
-				lcd_addr_x = simple_strtoul(esc, &endp, 10);
-				esc = endp;
+				if (kstrtoul(esc, 10, &lcd_addr_x) < 0)
+					break;
 			} else if (*esc == 'y') {
 				esc++;
-				lcd_addr_y = simple_strtoul(esc, &endp, 10);
-				esc = endp;
+				if (kstrtoul(esc, 10, &lcd_addr_y) < 0)
+					break;
 			} else
 				break;
 		}
Signature · 1 line
1.7.3.4
#1 lore raw
Quoted 34 lines · Pelle Windestam

Fixed the checkpatch warning about sing simple_strtoul instead of kstrtoul() in panel.c.

---
 drivers/staging/panel/panel.c |   10 ++++------

 1 files changed, 4 insertions(+), 6 deletions(-)
drivers/staging/panel/panel.c +4 -7
index b303b7e..4683d5f 100644
@@ -1179,16 +1179,14 @@ static inline int handle_lcd_special_code(void)
                        break;
 
                while (*esc) {
-                       char *endp;
-
                        if (*esc == 'x') {
                                esc++;
-                               lcd_addr_x = simple_strtoul(esc, &endp, 10);
-                               esc = endp;
+                               if (kstrtoul(esc, 10, &lcd_addr_x) < 0)
+                                       break;
                        } else if (*esc == 'y') {
                                esc++;
-                               lcd_addr_y = simple_strtoul(esc, &endp, 10);
-                               esc = endp;
+                               if (kstrtoul(esc, 10, &lcd_addr_y) < 0)
+                                       break;
                        } else
                                break;
                }
--
Quoted 3 lines

1.7.3.4

Was there any reason for not accepting this patch?

//Pelle

#2 lore raw
Quoted 32 lines · Pelle Windestam
Quoted 31 lines · Pelle Windestam

Fixed the checkpatch warning about sing simple_strtoul instead of kstrtoul() in panel.c.

---
 drivers/staging/panel/panel.c |   10 ++++------

 1 files changed, 4 insertions(+), 6 deletions(-)
drivers/staging/panel/panel.c +4 -6
index b303b7e..4683d5f 100644
@@ -1179,16 +1179,14 @@ static inline int handle_lcd_special_code(void)
                        break;
 
                while (*esc) {
-                       char *endp;
-
                        if (*esc == 'x') {
                                esc++;
-                               lcd_addr_x = simple_strtoul(esc, &endp, 10);
-                               esc = endp;
+                               if (kstrtoul(esc, 10, &lcd_addr_x) < 0)
+                                       break;
                        } else if (*esc == 'y') {
                                esc++;
-                               lcd_addr_y = simple_strtoul(esc, &endp, 10);
-                               esc = endp;
+                               if (kstrtoul(esc, 10, &lcd_addr_y) < 0)
+                                       break;
                        } else
Quoted 8 lines
Quoted 6 lines
drivers/staging/panel/panel.c +0 -1
                                break;
                }
--

1.7.3.4

Was there any reason for not accepting this patch?

I don't recall ever seeing it before, care to resend it against the latest linux-next tree so I can apply it?

thanks,

greg k-h

#3 lore raw
Quoted 8 lines · Greg KH

I don't recall ever seeing it before, care to resend it against the latest linux-next tree so I can apply it?

thanks,

greg k-h

When I checked the linux-next tree again it appears that it has already been applied, sorry about not noticing that before.

//Pelle