All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: comedi: kcomedilib: replace deprecated simple_strtoul() with kstrtouint()
@ 2014-02-15  3:59 Chase Southwood
  2014-02-17 13:09 ` Ian Abbott
  0 siblings, 1 reply; 2+ messages in thread
From: Chase Southwood @ 2014-02-15  3:59 UTC (permalink / raw)
  To: gregkh; +Cc: abbotti, hsweeten, devel, linux-kernel, Chase Southwood

Since simple_strtoul() has been deprecated, replace it with kstrtouint().
Also, since return code checking for this new function is enforced, add a
check to ensure that the conversion has succeeded.

Signed-off-by: Chase Southwood <chase.southwood@yahoo.com>
---
 drivers/staging/comedi/kcomedilib/kcomedilib_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/kcomedilib/kcomedilib_main.c b/drivers/staging/comedi/kcomedilib/kcomedilib_main.c
index 7dc5a18..8923e65 100644
--- a/drivers/staging/comedi/kcomedilib/kcomedilib_main.c
+++ b/drivers/staging/comedi/kcomedilib/kcomedilib_main.c
@@ -41,7 +41,8 @@ struct comedi_device *comedi_open(const char *filename)
 	if (strncmp(filename, "/dev/comedi", 11) != 0)
 		return NULL;
 
-	minor = simple_strtoul(filename + 11, NULL, 0);
+	if (kstrtouint(filename + 11, 0, &minor))
+		return NULL;
 
 	if (minor >= COMEDI_NUM_BOARD_MINORS)
 		return NULL;
-- 
1.8.5.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Staging: comedi: kcomedilib: replace deprecated simple_strtoul() with kstrtouint()
  2014-02-15  3:59 [PATCH] Staging: comedi: kcomedilib: replace deprecated simple_strtoul() with kstrtouint() Chase Southwood
@ 2014-02-17 13:09 ` Ian Abbott
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Abbott @ 2014-02-17 13:09 UTC (permalink / raw)
  To: Chase Southwood, gregkh; +Cc: hsweeten, devel, linux-kernel

On 2014-02-15 03:59, Chase Southwood wrote:
> Since simple_strtoul() has been deprecated, replace it with kstrtouint().
> Also, since return code checking for this new function is enforced, add a
> check to ensure that the conversion has succeeded.
>
> Signed-off-by: Chase Southwood <chase.southwood@yahoo.com>
> ---
>   drivers/staging/comedi/kcomedilib/kcomedilib_main.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/comedi/kcomedilib/kcomedilib_main.c b/drivers/staging/comedi/kcomedilib/kcomedilib_main.c
> index 7dc5a18..8923e65 100644
> --- a/drivers/staging/comedi/kcomedilib/kcomedilib_main.c
> +++ b/drivers/staging/comedi/kcomedilib/kcomedilib_main.c
> @@ -41,7 +41,8 @@ struct comedi_device *comedi_open(const char *filename)
>   	if (strncmp(filename, "/dev/comedi", 11) != 0)
>   		return NULL;
>
> -	minor = simple_strtoul(filename + 11, NULL, 0);
> +	if (kstrtouint(filename + 11, 0, &minor))
> +		return NULL;
>
>   	if (minor >= COMEDI_NUM_BOARD_MINORS)
>   		return NULL;
>

Looks good!

Reviewed-by: Ian Abbott <abbotti@mev.co.uk>

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-17 13:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-15  3:59 [PATCH] Staging: comedi: kcomedilib: replace deprecated simple_strtoul() with kstrtouint() Chase Southwood
2014-02-17 13:09 ` Ian Abbott

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.