From patchwork Sat Jun 21 12:06:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Walter X-Patchwork-Id: 4393961 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E7EAF9F314 for ; Sat, 21 Jun 2014 12:06:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0782620270 for ; Sat, 21 Jun 2014 12:06:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 26A2520221 for ; Sat, 21 Jun 2014 12:06:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758258AbaFUMGn (ORCPT ); Sat, 21 Jun 2014 08:06:43 -0400 Received: from mail-we0-f172.google.com ([74.125.82.172]:46706 "EHLO mail-we0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758257AbaFUMGm (ORCPT ); Sat, 21 Jun 2014 08:06:42 -0400 Received: by mail-we0-f172.google.com with SMTP id u57so4934645wes.17 for ; Sat, 21 Jun 2014 05:06:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=EQGzTQS4zFzHmNzX5F+b4oChNwhPmebx87vBVaHqVBU=; b=bK6pqHFaQW7pXXBkY1bQhuK3nJIhowYbsiqQv+Oj608xyfNgpnXUd0CqpeRf/X0yTz 7mZh8WfptPzeulVsVSyf+cfcjfzuUg9GQ33RDuKp9GlbKo+Ry08K90jiBzw3cP4+RVDa xZsZOJ2TNj0QwnRv94bJcM01Z7i/04OeLxXRUYq5KFZEkeGQ14BP6JyZUkqvsLrg6i0K lkSRqc8rWc/TsXq89SVNWUBmKO21w2qclwO7qEuk4XKNRfYsNTklZbErsmzh2wbd3iu1 rrgmVsgc512qWfucQY4RxngntE0ecvw6NRYF+goHiKo+BFWfeH3pBonuD5O3O2o1AYkz sBnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=EQGzTQS4zFzHmNzX5F+b4oChNwhPmebx87vBVaHqVBU=; b=JW9eQhffe80EoCNpx95IwRpqSJ/AL+cWx0c4qiRT4m0C7a/n7ZcdkrRf8TlFuN8bdB F5Z+bNticlui8X106qNSquoxOWV06DqAbVb7WB3+dh2PqRK6PWJSTqkHD6Ri6KIMkrRA TFD05oshns03fz6CKgC0KXfE4vnLTDQCRGmCSjWW7GsJtFHH3KRduyziYmb3lu2VlGpy x2YGh5+3coKvVxZWcEwFzNOrWnGWbh9u08ATNMEr+lg8Xm0XBHTdoZxoBdi8TsSRM7rM Tn2C1fBK8SpViyOgFOCccUqqL2pKF7OrCsSIaP37jSVGht2E7uBQqMR0S3tbuHWYfLEo f3wg== X-Gm-Message-State: ALoCoQmce51gpC2yWQwH6grHI2XggOb5tKI5GRmhI/BX+1zn+IvMFozssawzNTSGRoTlJMe9ta1v X-Received: by 10.194.22.100 with SMTP id c4mr11706578wjf.89.1403352400716; Sat, 21 Jun 2014 05:06:40 -0700 (PDT) Received: from google.com ([2620:0:1040:202:2e44:fdff:fe1c:7ea6]) by mx.google.com with ESMTPSA id hs8sm13596916wib.10.2014.06.21.05.06.39 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 21 Jun 2014 05:06:40 -0700 (PDT) Date: Sat, 21 Jun 2014 13:06:38 +0100 From: Daniel Walter To: Trond Myklebust , linux-kernel@vger.kernel.org Cc: linux-nfs@vger.kernel.org Subject: [PATCH 8/9] [net/sunrpc] replace strict_strto calls Message-ID: <20140621120638.GA8908@google.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FSL_HELO_FAKE, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Replace obsolete strict_strto calls with appropriate kstrto calls Signed-off-by: Daniel Walter --- net/sunrpc/addr.c | 16 ++++++---------- net/sunrpc/auth.c | 2 +- net/sunrpc/xprtsock.c | 4 ++-- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/net/sunrpc/addr.c b/net/sunrpc/addr.c index a622ad6..2e0a6f9 100644 --- a/net/sunrpc/addr.c +++ b/net/sunrpc/addr.c @@ -176,7 +176,7 @@ static int rpc_parse_scope_id(struct net *net, const char *buf, len = (buf + buflen) - delim - 1; p = kstrndup(delim + 1, len, GFP_KERNEL); if (p) { - unsigned long scope_id = 0; + u32 scope_id = 0; struct net_device *dev; dev = dev_get_by_name(net, p); @@ -184,7 +184,7 @@ static int rpc_parse_scope_id(struct net *net, const char *buf, scope_id = dev->ifindex; dev_put(dev); } else { - if (strict_strtoul(p, 10, &scope_id) == 0) { + if (kstrtou32(p, 10, &scope_id) == 0) { kfree(p); return 0; } @@ -304,7 +304,7 @@ char *rpc_sockaddr2uaddr(const struct sockaddr *sap, gfp_t gfp_flags) * @sap: buffer into which to plant socket address * @salen: size of buffer * - * @uaddr does not have to be '\0'-terminated, but strict_strtoul() and + * @uaddr does not have to be '\0'-terminated, but kstrtou8() and * rpc_pton() require proper string termination to be successful. * * Returns the size of the socket address if successful; otherwise @@ -315,7 +315,7 @@ size_t rpc_uaddr2sockaddr(struct net *net, const char *uaddr, const size_t salen) { char *c, buf[RPCBIND_MAXUADDRLEN + sizeof('\0')]; - unsigned long portlo, porthi; + u8 portlo, porthi; unsigned short port; if (uaddr_len > RPCBIND_MAXUADDRLEN) @@ -327,18 +327,14 @@ size_t rpc_uaddr2sockaddr(struct net *net, const char *uaddr, c = strrchr(buf, '.'); if (unlikely(c == NULL)) return 0; - if (unlikely(strict_strtoul(c + 1, 10, &portlo) != 0)) - return 0; - if (unlikely(portlo > 255)) + if (unlikely(kstrtou8(c + 1, 10, &portlo) != 0)) return 0; *c = '\0'; c = strrchr(buf, '.'); if (unlikely(c == NULL)) return 0; - if (unlikely(strict_strtoul(c + 1, 10, &porthi) != 0)) - return 0; - if (unlikely(porthi > 255)) + if (unlikely(kstrtou8(c + 1, 10, &porthi) != 0)) return 0; port = (unsigned short)((porthi << 8) | portlo); diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index 247e973..7e9e4bb 100644 --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c @@ -48,7 +48,7 @@ static int param_set_hashtbl_sz(const char *val, const struct kernel_param *kp) if (!val) goto out_inval; - ret = strict_strtoul(val, 0, &num); + ret = kstrtoul(val, 0, &num); if (ret == -EINVAL) goto out_inval; nbits = fls(num); diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index be8bbd5..1f2baac 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -3054,12 +3054,12 @@ static int param_set_uint_minmax(const char *val, const struct kernel_param *kp, unsigned int min, unsigned int max) { - unsigned long num; + unsigned int num; int ret; if (!val) return -EINVAL; - ret = strict_strtoul(val, 0, &num); + ret = kstrtouint(val, 0, &num); if (ret == -EINVAL || num < min || num > max) return -EINVAL; *((unsigned int *)kp->arg) = num;