Message ID | 0cce4257-6c22-4c0a-b769-b946990413fe@moroto.mountain |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp2726126vqy; Mon, 4 Dec 2023 04:30:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IGc5ty2SY6oDro3sXyeT8L7z7CdscXfZBPv483pSoZsY4O7i5b0FN3Ectb3i7xn66xulaBc X-Received: by 2002:a17:90b:388a:b0:285:8673:450d with SMTP id mu10-20020a17090b388a00b002858673450dmr2758296pjb.40.1701693057766; Mon, 04 Dec 2023 04:30:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701693057; cv=none; d=google.com; s=arc-20160816; b=dhhAhxh64N0vd1G2h0+SlqDoJFDg8MkEKTG4g9bVj0iIot3DCnqlxmK8CDrgPDzdgy 3/sd4mcCGDaiRRryqIUPoWHKWdJasypAVWby9XQv22O9Lkeg1bug3FFEvSowz5lZbtsm tBqXqE3YKTjGawpy4nGanN0SLTyvCTBM0fMeEZS8IgxYBlmjsT/hzyIowL157QgFfWaM yZ4MdxBU2KdVAVMsMbHPUqLRfG3C1k05/6XkBKYuWDvpHhhu9bFdST6IDd1DGIWApx/x ol4RCIHunW/o5V/DOojkb5FSsipI2SLXxQca2MiwvskPxYmpzcZ6gfEevVy9aOthwnV4 5P5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=HKvSKITUcl+fN4QbSnsBMTLDMl3HA5xQPt9QvlGXEbI=; fh=4qsK0BJTbP/VDWiz4NPB4Evbm8HhfJTbSTkYWfEdzt0=; b=sPZOk2Y5k1F1bzAH0BHKvoxMIDFlv4qPyyp9lZ/64+9M6zQWjPcMpSilcJoIXSDHCB dPJMx+K5HXhwcuftL/Jgril3Z8YCHawPKmlqN3op1Z85Xk48JO5k08s/6JzeMRcJkmB/ jlbhajcoP+xjrDUdUAuhKmyIteNKESUDwqsTGztwws3fNYvzhbhBOiJYbxU7klJxy41l ldJsi0stcp5UG3tyiWArk9ktSBUiBFC3nLAmmNQQbXEy+azwBOCncwHI9aQZd7UEvqqi TNDvbGCj9hs5aJy770Tt0vAjjEZccuygMYgtMt2GTBrwSRN3k0L/zF88EQg6DhCSwomC wCRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iidQi2oE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id gm10-20020a17090b100a00b00280ca5f4ca5si3275088pjb.113.2023.12.04.04.30.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 04:30:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iidQi2oE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id B3A16808985B; Mon, 4 Dec 2023 04:30:21 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344002AbjLDMaG (ORCPT <rfc822;chrisfriedt@gmail.com> + 99 others); Mon, 4 Dec 2023 07:30:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344005AbjLDMaF (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 4 Dec 2023 07:30:05 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5025DDF for <linux-kernel@vger.kernel.org>; Mon, 4 Dec 2023 04:30:11 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40b27726369so44794495e9.0 for <linux-kernel@vger.kernel.org>; Mon, 04 Dec 2023 04:30:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701693010; x=1702297810; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=HKvSKITUcl+fN4QbSnsBMTLDMl3HA5xQPt9QvlGXEbI=; b=iidQi2oEZuoBshT399Uzx8Izs0wKDb026uVoEHZDKjFt7urmkr/zbOR0NCH5+jQQVI HznfLEFwTl+OpY6J3gHQkQBwaSrNYChAC1mJPq59pU76aOZnnf+9XQ4jmBaBgNRuneFG 4EFLAEbk9qZfACPXqi/XTzLa7GmSuV5+ERaT/MDTCNOKZfvgrFO69VMLmLtqt8UXPz/7 wmP3e0zLK0bkG9KDDQM0Xb6A6XXXaOQkTP0VnTIOStAsV+QX8xNIOOLY5em/mssQYVBk xht8L2ZfQ/2gPCCwTtG0RuokVmeVAVH0nEbB33yAPNa3BhP1kcN6Gc6JJ+tQMf0J+KSP N/Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701693010; x=1702297810; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HKvSKITUcl+fN4QbSnsBMTLDMl3HA5xQPt9QvlGXEbI=; b=RhqEygXBOZmhNX0QMZo6o/CGT26wQucLAdSbRszMmsRcsX05iFP0nF+qrVwCqhUKir Q3dCzWUk6hShVO8wauub0n+kWE5DUicPElxLr8pl9z29S6CzQ6mCiIUY0Jl83gaBamsX wOKJ34PxZYa5lp/mNVedfaSZPGLlK0EyBi0cDMuse3rYOgKCiE1HZo922ibgin1o8uEM K+J8N55uVybjC/fzmUBSfZFFNbMiNeJ9YtNnqOfs7QGcWA1jzDRTD+gZWlVSv3GIefev 2Nff3x06yW5kQ7YRspBaEnptDgVo9TInsgm/wMlVRFVzr5tJj0GP5zWOkVDwuCn8mkaN 9cBw== X-Gm-Message-State: AOJu0YyuFfz+cNetTYgcqQd3v3/FMMvBbvDnK++LwxDGuAvVXcg/R6RB bduXO2HrTubJm4ECq3gd1yArtg== X-Received: by 2002:a05:600c:3417:b0:40b:5e59:da7a with SMTP id y23-20020a05600c341700b0040b5e59da7amr2376583wmp.141.1701693009855; Mon, 04 Dec 2023 04:30:09 -0800 (PST) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id o18-20020a05600c511200b004064e3b94afsm18454841wms.4.2023.12.04.04.30.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 04:30:09 -0800 (PST) Date: Mon, 4 Dec 2023 15:30:06 +0300 From: Dan Carpenter <dan.carpenter@linaro.org> To: Chuck Lever <chuck.lever@oracle.com> Cc: Jeff Layton <jlayton@kernel.org>, Neil Brown <neilb@suse.de>, Olga Kornievskaia <kolga@netapp.com>, Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>, linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] nfsd: remove unnecessary NULL check Message-ID: <0cce4257-6c22-4c0a-b769-b946990413fe@moroto.mountain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 04 Dec 2023 04:30:21 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784354499634339911 X-GMAIL-MSGID: 1784354499634339911 |
Series |
nfsd: remove unnecessary NULL check
|
|
Commit Message
Dan Carpenter
Dec. 4, 2023, 12:30 p.m. UTC
We check "state" for NULL on the previous line so it can't be NULL here.
No need to check again.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/r/202312031425.LffZTarR-lkp@intel.com/
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
fs/nfsd/nfs4state.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon, 2023-12-04 at 15:30 +0300, Dan Carpenter wrote: > We check "state" for NULL on the previous line so it can't be NULL here. > No need to check again. > > Reported-by: kernel test robot <lkp@intel.com> > Closes: https://lore.kernel.org/r/202312031425.LffZTarR-lkp@intel.com/ > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> > --- > fs/nfsd/nfs4state.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c > index 40415929e2ae..fb551a3db1dc 100644 > --- a/fs/nfsd/nfs4state.c > +++ b/fs/nfsd/nfs4state.c > @@ -6639,7 +6639,7 @@ __be32 manage_cpntf_state(struct nfsd_net *nn, stateid_t *st, > spin_unlock(&nn->s2s_cp_lock); > if (!state) > return nfserr_bad_stateid; > - if (!clp && state) > + if (!clp) > *cps = state; > return 0; > } Reviewed-by: Jeff Layton <jlayton@kernel.org>
On Mon, Dec 04, 2023 at 03:30:06PM +0300, Dan Carpenter wrote: > We check "state" for NULL on the previous line so it can't be NULL here. > No need to check again. > > Reported-by: kernel test robot <lkp@intel.com> > Closes: https://lore.kernel.org/r/202312031425.LffZTarR-lkp@intel.com/ > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> LGTM. Applied to nfsd-next for v6.8. > --- > fs/nfsd/nfs4state.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c > index 40415929e2ae..fb551a3db1dc 100644 > --- a/fs/nfsd/nfs4state.c > +++ b/fs/nfsd/nfs4state.c > @@ -6639,7 +6639,7 @@ __be32 manage_cpntf_state(struct nfsd_net *nn, stateid_t *st, > spin_unlock(&nn->s2s_cp_lock); > if (!state) > return nfserr_bad_stateid; > - if (!clp && state) > + if (!clp) > *cps = state; > return 0; > } > -- > 2.42.0 >
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 40415929e2ae..fb551a3db1dc 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -6639,7 +6639,7 @@ __be32 manage_cpntf_state(struct nfsd_net *nn, stateid_t *st, spin_unlock(&nn->s2s_cp_lock); if (!state) return nfserr_bad_stateid; - if (!clp && state) + if (!clp) *cps = state; return 0; }