Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752689AbdDNIQo (ORCPT ); Fri, 14 Apr 2017 04:16:44 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49000 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751511AbdDNIQm (ORCPT ); Fri, 14 Apr 2017 04:16:42 -0400 Date: Fri, 14 Apr 2017 10:16:31 +0200 From: Greg Kroah-Hartman To: Marcin Ciupak Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Oleg Drokin , Andreas Dilger , lustre-devel@lists.lustre.org Subject: Re: [PATCH v2] staging: lustre: replace simple_strtoul with kstrtoint Message-ID: <20170414081631.GC16598@kroah.com> References: <20170321124609.GA3896@gentoo> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170321124609.GA3896@gentoo> User-Agent: Mutt/1.8.1 (2017-04-11) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1296 Lines: 37 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 > --- > 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