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

From: Dan Carpenter
Date: Wed Oct 06 2010 - 00:44:26 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/