Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1592224

Re: [Outreachy kernel] [PATCH 2/6] staging: speakup: simple_strtoul is replaced with kstrtoul

From Julia Lawall <julia.lawall@lip6.fr>
Newsgroups linux.kernel
Subject Re: [Outreachy kernel] [PATCH 2/6] staging: speakup: simple_strtoul is replaced with kstrtoul
Date 2017-03-03 20:00 +0100
Message-ID <th0AN-5fC-9@gated-at.bofh.it> (permalink)
References <th0r7-5c2-5@gated-at.bofh.it> <th0AN-5fC-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On Sat, 4 Mar 2017, Arushi Singhal wrote:

> This patch fixes "simple_strtoul is obsolete, use kstrtoul instead"
> warning.
>
> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
> ---
>  drivers/staging/speakup/kobjects.c    | 4 ++--
>  drivers/staging/speakup/main.c        | 2 +-
>  drivers/staging/speakup/varhandlers.c | 2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/speakup/kobjects.c b/drivers/staging/speakup/kobjects.c
> index edde9e68779e..a82698c66568 100644
> --- a/drivers/staging/speakup/kobjects.c
> +++ b/drivers/staging/speakup/kobjects.c
> @@ -152,7 +152,7 @@ static ssize_t chars_chartab_store(struct kobject *kobj,
>  			continue;
>  		}
>
> -		index = simple_strtoul(cp, &temp, 10);
> +		index = kstrtoul(cp, &temp, 10);

It seems unlikely that you actually compiled this code.  The argument list
for kstrtoul has a completely different set of types.

julia

>  		if (index > 255) {
>  			rejected++;
>  			cp = linefeed + 1;
> @@ -785,7 +785,7 @@ static ssize_t message_store_helper(const char *buf, size_t count,
>  			continue;
>  		}
>
> -		index = simple_strtoul(cp, &temp, 10);
> +		index = kstrtoul(cp, &temp, 10);
>
>  		while ((temp < linefeed) && (*temp == ' ' || *temp == '\t'))
>  			temp++;
> diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
> index 17df20ec94be..b43e2e156602 100644
> --- a/drivers/staging/speakup/main.c
> +++ b/drivers/staging/speakup/main.c
> @@ -1945,7 +1945,7 @@ static int handle_goto(struct vc_data *vc, u_char type, u_char ch, u_short key)
>  		return 1;
>  	}
>
> -	goto_pos = simple_strtoul(goto_buf, &cp, 10);
> +	goto_pos = kstrtoul(goto_buf, &cp, 10);
>
>  	if (*cp == 'x') {
>  		if (*goto_buf < '0')
> diff --git a/drivers/staging/speakup/varhandlers.c b/drivers/staging/speakup/varhandlers.c
> index cc984196020f..5107533bb45a 100644
> --- a/drivers/staging/speakup/varhandlers.c
> +++ b/drivers/staging/speakup/varhandlers.c
> @@ -325,7 +325,7 @@ char *spk_s2uchar(char *start, char *dest)
>  {
>  	int val;
>
> -	val = simple_strtoul(skip_spaces(start), &start, 10);
> +	val = kstrtoul(skip_spaces(start), &start, 10);
>  	if (*start == ',')
>  		start++;
>  	*dest = (u_char)val;
> --
> 2.11.0
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170303183707.14830-3-arushisinghal19971997%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] multiple checkpatch issues Arushi Singhal <arushisinghal19971997@gmail.com> - 2017-03-03 19:50 +0100
  Re: [Outreachy kernel] [PATCH 2/6] staging: speakup: simple_strtoul  is replaced with kstrtoul Julia Lawall <julia.lawall@lip6.fr> - 2017-03-03 20:00 +0100
  [PATCH 6/6] staging: speakup: fixes braces {} should be used on all arms of this statement Arushi Singhal <arushisinghal19971997@gmail.com> - 2017-03-03 20:40 +0100
  [PATCH 2/6] staging: speakup: simple_strtoul is replaced with kstrtoul Arushi Singhal <arushisinghal19971997@gmail.com> - 2017-03-03 20:50 +0100
  [PATCH 1/6] staging: speakup: Add blank line after function/struct/union/enum declarations Arushi Singhal <arushisinghal19971997@gmail.com> - 2017-03-03 20:50 +0100

csiph-web