Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp433736pxb; Wed, 29 Sep 2021 02:19:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7LD0IoSAGw2V4rg5PYeqmJ0SY/enrsQ6V4eJDL6gZl7u7ct58537qp9EjmiTUJpSkE9o6 X-Received: by 2002:a17:902:650f:b0:13e:d6c:4471 with SMTP id b15-20020a170902650f00b0013e0d6c4471mr2020138plk.80.1632907167491; Wed, 29 Sep 2021 02:19:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632907167; cv=none; d=google.com; s=arc-20160816; b=w2QSe+mHfruLrsjfPhcW1cs0xGps2GvpFFkhUZppndrbGTPRzoLx7vF0cpgfLiPl2B V3cqjduaoeeZDzDLcn4wnktLhyrMCM7rmhIxielmwcZMXqsX7BkhLuqwlLEbYvGHPrd/ 0HOaxaes/VndSowY0ZMgNFrRnMMnAgeQXuIJpA3Y75wFcZF+FUYBA2CFhikFCDnvNuZU 4+io4jwPhkBvlF70OW8FNhdnyXqqlTr0azEGOPQ+r60jCJXKdfZ56EIe2Qc1tECEWfMm pxhvKHG2rVBykm+EKbyFQHvRhXUGktm3C7wcyRW5KWG79MLKeqU9TXHyiBTCE+o5MxBI hBhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=hlirUB/yAn/dC1uLqVE443efNbcN20xlJKTntEUyl+M=; b=m9I7GD6yxtdQ1744j1duZuOuHnJ+noesY+0GCvUTuADaZgWBRg27qfKhlydglJZwyu yrSNTavxQ+nHls13GnNAsWnh64mbCE0YIAVr3KL9/MqyJvMoldL8v4oGlmZUEyNQ1y/g ovsbpJgK8lFwYxizoBsn2nZx1QQn9FD8nBwceSRNq+2oK4XOO7L/KHybfWOt6dqBQO7U ilVL9C1kMrYF3VbyvXDkoLeqnvdYsRBysHABvEw6VwlQMQM5bs8wAefkXX/faSGnbJq3 meq52mVbA6Ke/ZHN7TT8YEEMxbho+bamDH53Q/KGCgZdDWAJwI3Z8hF+SskuCDJACrWb O/Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=Irc7MT5O; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f13si2170861pfq.281.2021.09.29.02.18.37; Wed, 29 Sep 2021 02:19:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=Irc7MT5O; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243670AbhI2JTm (ORCPT + 99 others); Wed, 29 Sep 2021 05:19:42 -0400 Received: from m12-13.163.com ([220.181.12.13]:47546 "EHLO m12-13.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230347AbhI2JTl (ORCPT ); Wed, 29 Sep 2021 05:19:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=hlirU B/yAn/dC1uLqVE443efNbcN20xlJKTntEUyl+M=; b=Irc7MT5OpBf0aVccoOa/x Bhq4PsW7mb8GBVQcNbsg9s+ZtdloeGnKP5r8xwWCn1BirLdF/ajucjZ2fFuD9Jz8 19zZkfMvaG7XGdQJJw+/QbLqteqNvsWNUjOdErGvwOa1PFNDhu00siJVTAehy49+ /zAp9eLVpZW9BwizPll7fs= Received: from COOL-20201222LC.ccdomain.com (unknown [218.94.48.178]) by smtp9 (Coremail) with SMTP id DcCowAC3q7gBL1RhSilEGg--.19878S2; Wed, 29 Sep 2021 17:16:52 +0800 (CST) From: dingsenjie@163.com To: bfields@fieldses.org, chuck.lever@oracle.com Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, dingsenjie Subject: [PATCH] fs: nfsd: Simplify the return expression of numeric_name_to_id Date: Wed, 29 Sep 2021 17:16:26 +0800 Message-Id: <20210929091626.11828-1-dingsenjie@163.com> X-Mailer: git-send-email 2.21.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: DcCowAC3q7gBL1RhSilEGg--.19878S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrKw4UXrykCw4UJFWDtw1DKFg_yoWfZFc_Gw 4Iq3y8uFs0yrW5CrZ8JFWjqryvvayktr10g3yIgay7GF98Jw48Zrs3AF9rGFyUWFWrXF98 ur1xGrWak3W09jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU8ltC7UUUUU== X-Originating-IP: [218.94.48.178] X-CM-SenderInfo: 5glqw25hqmxvi6rwjhhfrp/1tbiYwUdyFaEEsHVfgAAsZ Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: dingsenjie Simplify the return expression in the nfs4idmap.c Signed-off-by: dingsenjie --- fs/nfsd/nfs4idmap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c index f92161c..dc5926c 100644 --- a/fs/nfsd/nfs4idmap.c +++ b/fs/nfsd/nfs4idmap.c @@ -603,7 +603,6 @@ static __be32 idmap_id_to_name(struct xdr_stream *xdr, static bool numeric_name_to_id(struct svc_rqst *rqstp, int type, const char *name, u32 namelen, u32 *id) { - int ret; char buf[11]; if (namelen + 1 > sizeof(buf)) @@ -612,8 +611,7 @@ static __be32 idmap_id_to_name(struct xdr_stream *xdr, /* Just to make sure it's null-terminated: */ memcpy(buf, name, namelen); buf[namelen] = '\0'; - ret = kstrtouint(buf, 10, id); - return ret == 0; + return kstrtouint(buf, 10, id) == 0; } static __be32 -- 1.9.1