Re: [PATCH 10/28] Staging: comedi: kcomedilib: kcomedilib_main.c: Edit file so that checkpatch.pl has 0 errors and warnings

Dan Carpenter
2010-10-06T04:44:19Z

On Tue, Oct 05, 2010 at 09:00:25PM -0400, Tracey Dent wrote:
> @@ -50,7 +50,7 @@ struct comedi_device *comedi_open(const char *filename)
> if (strncmp(filename, "/dev/comedi", 11) != 0)
> return NULL;
>
> - minor = simple_strtoul(filename + 11, NULL, 0);
> + minor = strict_strtoul(filename + 11, NULL, 0);
>

No, this doesn't work. strict_strtoul() only returns zero and -EINVAL.
It doesn't return the number.

GCC even warns about this change:
drivers/staging/comedi/kcomedilib/kcomedilib_main.c: In function ‘comedi_open’:
drivers/staging/comedi/kcomedilib/kcomedilib_main.c:53: warning:
passing argument 2 of ‘strict_strtoul’ makes integer from pointer without a cast

Please at least compile these before sending. :(

> if (minor >= COMEDI_NUM_BOARD_MINORS)
> return NULL;

regards,
dan carpenter