Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932529AbdCUMrK (ORCPT ); Tue, 21 Mar 2017 08:47:10 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:35102 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757147AbdCUMrF (ORCPT ); Tue, 21 Mar 2017 08:47:05 -0400 Date: Tue, 21 Mar 2017 13:46:09 +0100 From: Marcin Ciupak To: Greg Kroah-Hartman Cc: Andreas Dilger , James Simmons , Oleg Drokin , lustre-devel@lists.lustre.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] staging: lustre: replace simple_strtoul with kstrtoint Message-ID: <20170321124609.GA3896@gentoo> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1528 Lines: 43 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); clear++; } else if (strncmp(s1, "recovery_time_hard=", 19) == 0) { - lmd->lmd_recovery_time_hard = 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_hard = max_t(int, res, time_min); clear++; } else if (strncmp(s1, "noir", 4) == 0) { lmd->lmd_flags |= LMD_FLG_NOIR; /* test purpose only. */ -- 2.11.1