Convert simple_strtoul to kstrtoul
Subsystems (2)
PATCH v4 1/1 Convert simple_strtoul to kstrtoul
This patch fixes the checkpatch.pl warning:simple_strtoul is obsolete, use kstrtoul instead.
Replaced simple_strtoul with kstrtoul as both can perform parsing error checks on the string to the converted. The parsing error condition for simple_strtoul is that the string to be converted is same as the converted string, with kstrtoul the return value is non-zero in case of this error.
---
Changes in v4:
-Updated commit explanation to be more generic.
drivers/staging/media/parport/bw-qcam.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/media/parport/bw-qcam.c +1 -3
@@ -1106,10 +1106,8 @@ static int accept_bwqcam(struct parport *port)if (parport[0 ] &&strncmp (parport[0 ],"auto" ,4 ) !=0 ) {/* user gave parport parameters */ for (n =0 ; n <MAX_CAMS && parport[n]; n++) { -char *ep;unsigned long r; - r =simple_strtoul (parport[n], &ep,0 ); -if (ep == parport[n]) { +if (kstrtoul (parport[n],0 , &r)) {printk (KERN_ERR "bw-qcam: bad port specifier \"%s\"\n" , parport[n]);
Signature · 1 line
1.9.1
Greg KH
maintainerQuoted 8 lines · Navya Sri Nizamkari
This patch fixes the checkpatch.pl warning:
simple_strtoulis obsolete, use kstrtoul instead.Replaced
simple_strtoulwith kstrtoul as both can perform parsing error checks on the string to the converted. The parsing error condition forsimple_strtoulis that the string to be converted is same as the converted string, with kstrtoul the return value is non-zero in case of this error.
Quoted 6 lines
Signed-off-by Navya Sri Nizamkari <[email protected]>---
Changes in v4:
-Updated commit explanation to be more generic.drivers/staging/media/parport/bw-qcam.c | 4 +---
This file is no longer in Linus's tree :(