From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756889AbbGTWMd (ORCPT ); Mon, 20 Jul 2015 18:12:33 -0400 Received: from mail-wg0-f53.google.com ([74.125.82.53]:33381 "EHLO mail-wg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752455AbbGTWMb (ORCPT ); Mon, 20 Jul 2015 18:12:31 -0400 Date: Tue, 21 Jul 2015 01:12:26 +0300 From: Alexey Dobriyan To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, ooo@electrozaur.com Subject: [PATCH -mm] parse_integer: convert fs/exofs/ Message-ID: <20150720221226.GB8907@p183.telecom.by> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert deprecated simple_strtoull() usage. Copying option string is unnecessary as you can parse directly from the original string. Signed-off-by: Alexey Dobriyan --- fs/exofs/super.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- a/fs/exofs/super.c +++ b/fs/exofs/super.c @@ -84,6 +84,7 @@ static int parse_options(char *options, struct exofs_mountopt *opts) substring_t args[MAX_OPT_ARGS]; int option; bool s_pid = false; + int rv; EXOFS_DBGMSG("parse_options %s\n", options); /* defaults */ @@ -92,7 +93,6 @@ static int parse_options(char *options, struct exofs_mountopt *opts) while ((p = strsep(&options, ",")) != NULL) { int token; - char str[32]; if (!*p) continue; @@ -108,9 +108,11 @@ static int parse_options(char *options, struct exofs_mountopt *opts) opts->is_osdname = true; break; case Opt_pid: - if (0 == match_strlcpy(str, &args[0], sizeof(str))) + rv = parse_integer(args[0].from, 0, &opts->pid); + if (rv < 0) + return rv; + if (args[0].from[rv] != '\0') return -EINVAL; - opts->pid = simple_strtoull(str, NULL, 0); if (opts->pid < EXOFS_MIN_PID) { EXOFS_ERR("Partition ID must be >= %u", EXOFS_MIN_PID);