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


Groups > linux.kernel > #1623557 > unrolled thread

Re: [PATCH v2] staging: lustre: replace simple_strtoul with kstrtoint

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2017-04-14 10:20 +0200
Last post2017-04-14 10:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v2] staging: lustre: replace simple_strtoul with kstrtoint Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-04-14 10:20 +0200

#1623557 — Re: [PATCH v2] staging: lustre: replace simple_strtoul with kstrtoint

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-04-14 10:20 +0200
SubjectRe: [PATCH v2] staging: lustre: replace simple_strtoul with kstrtoint
Message-ID<tw4Cu-7aA-21@gated-at.bofh.it>
On Tue, Mar 21, 2017 at 01:46:09PM +0100, Marcin Ciupak wrote:
> Replace simple_strtoul with kstrtoint.
> simple_strtoul is marked for obsoletion as reported by checkpatch.pl
> 
> Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com>
> ---
> v2:
> 	-improving kstrtoint error handling
> 	-updating commit message
> 
>  drivers/staging/lustre/lustre/obdclass/obd_mount.c | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c b/drivers/staging/lustre/lustre/obdclass/obd_mount.c
> index 8e0d4b1d86dc..42858ee5b444 100644
> --- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c
> +++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c
> @@ -924,12 +924,20 @@ static int lmd_parse(char *options, struct lustre_mount_data *lmd)
>  			lmd->lmd_flags |= LMD_FLG_ABORT_RECOV;
>  			clear++;
>  		} else if (strncmp(s1, "recovery_time_soft=", 19) == 0) {
> -			lmd->lmd_recovery_time_soft = max_t(int,
> -				simple_strtoul(s1 + 19, NULL, 10), time_min);
> +			int res;
> +
> +			rc = kstrtoint(s1 + 19, 10, &res);
> +			if (rc)
> +				goto invalid;
> +			lmd->lmd_recovery_time_soft = max_t(int, res, time_min);

Are you sure max_t is still needed here?

And have you tested this change?

thanks,

greg k-h

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web