Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1247055rwi; Mon, 10 Oct 2022 13:27:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM692BWqiKhOHMNiFAdIl2YkPd8kJ2tRRWbg2Wh/lTanUGLSS+RJse6WUKrJQnrko3m1p+jQ X-Received: by 2002:a17:907:7610:b0:78d:b374:898e with SMTP id jx16-20020a170907761000b0078db374898emr6969867ejc.28.1665433635518; Mon, 10 Oct 2022 13:27:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665433635; cv=none; d=google.com; s=arc-20160816; b=lLT/87em0KDOemLtbqKu8w1Wo3DMPnklmi69/l8hxArYPkdZurdp0j3oldhhpw2/1n u+IJFT2U8BRy6zDqtwe6OPeUD8LkdEzGbUSe23Xs4WZn/TI6vOr1snOQl3IuUZqL7Bo/ 4lXNw12w4xP2nt+W2r5dYvo7yj/BXICbPtaP2NKESCnJ6eIg/NRYUjfWR2UnisIysUxy veUpk+B/PwD1dE+e3i8LP6HS2JOFQeh6Hda9yy8YftLe144vQZHoL+agB5i5z6I78ij0 VOcy2OEwLBfsBV/GdeQyLli2hWrzev2FqPy4x+Z2DOtOOv704Ekx7tHQga0W5tSdEvAi vqgg== 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=uitibauigOgCccEn2okfAVkQvelKUvNuPxyBgEXlDaY=; b=OG0bfuP8QQ3pR1mbGBoyWt5pbVUQXuSYI8J74IbauPSsAkK4weCVqqzJRvt88tX+qS dJvM1sxGZ6J93xSrzy2Sf280qyAJ32KHoHgr/sLaAnu7wTexMqibaYsbdK3gqOxqPY5N iiogp+CrdYp4OLghL+zg7+XCIrgxvP4Zvu5Rqvdr/nd4lopM5ts573VAwaFAIGCq7Y6W 00fl6G7gkrOieYOPYm1+nRFFjp4v3R9dDYsUI0ACJng2roE8oa7YhNil4j6PetEuta4W H9D9haeuxN50YSP2RO8Rl5mtEOiEm4urmw23Z879TzZeEIf1tCbr+zrE5WDUUCm6NCwr b9Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=et+EKQ2U; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw29-20020a1709066a1d00b0077f3a9c58e2si12535495ejc.6.2022.10.10.13.26.38; Mon, 10 Oct 2022 13:27:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=et+EKQ2U; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230051AbiJJU0b (ORCPT + 99 others); Mon, 10 Oct 2022 16:26:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229966AbiJJU0C (ORCPT ); Mon, 10 Oct 2022 16:26:02 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A234C20195; Mon, 10 Oct 2022 13:24:55 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id fn7-20020a05600c688700b003b4fb113b86so7021583wmb.0; Mon, 10 Oct 2022 13:24:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=uitibauigOgCccEn2okfAVkQvelKUvNuPxyBgEXlDaY=; b=et+EKQ2UH93E+D2uoLEYylnzEhMHPMcJkxCQ8Qa/drFfxI7ar+NuOEmoG2FdjVQLlw RF5wo8jfcu8UzZlWh83Fcmo4HKc4GZu45be22mqPvKd9tWGz4MXbEzfB5pQ9B1CCovaW H9RaLTOvsRCFcJnGUvx78D8OQGOAn3xJTIJIxwZ2EesqJEJv1RxC6yc1/c4oT8uxkQIC rUd/cq/YAy50jhrgemql4uu85Nj8gP1JamZ/xUTv7A2gnQNcRgayy4b9AJtCTWjfOFu+ ZwGGzRL+y14SMldGbPEvL0iqqWi1liULDzAGeD5njltf0c7VWUu7HhjyiXhlp17tOd50 tN3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=uitibauigOgCccEn2okfAVkQvelKUvNuPxyBgEXlDaY=; b=FEy2WkT/q43hyp9n99Wy0qy2AZSXremelfxBmaBKsXraagZSpMPRH3Tq62dOOo6YlN HVMhx1MlebhOC+ZT7/lQOwaqXeD7xeuhfWRRO6PJfCtyMV62Nz1guTJDxfLZuu2R6jhP iQo/FALh/9BN572jFEKOWMcsnemxblJpOOoFK7an+ADs8BrF/QCsZGfMTuxfRcO0U431 v1AqstTbbloGRCCNJ52qTXbEXIN0R+jqxZar1xGHlTSwTJ9ag/8PJc9pIiOCOtHb0IWj 3lVsurgKfnK6t9TmIJdX5i43Y3TiuHFaQGfaEh1ZPCqb9sx58p5weQvhGN/WPmeB1Rel 5sLg== X-Gm-Message-State: ACrzQf3yAkW5Il5MAGI5hH0BXw1KC3/5VgCdVEe+vpBOGHzKcznfUSbY qNFOziqgGHhCWqGupo463Hs= X-Received: by 2002:a05:600c:3492:b0:3b4:9fcc:cbb6 with SMTP id a18-20020a05600c349200b003b49fcccbb6mr21690521wmq.42.1665433465419; Mon, 10 Oct 2022 13:24:25 -0700 (PDT) Received: from localhost (cpc154979-craw9-2-0-cust193.16-3.cable.virginm.net. [80.193.200.194]) by smtp.gmail.com with ESMTPSA id u16-20020adfdd50000000b002238ea5750csm12193769wrm.72.2022.10.10.13.24.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 13:24:24 -0700 (PDT) From: Colin Ian King To: Chuck Lever , Jeff Layton , linux-nfs@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] NFSD: Remove redundant assignment to variable host_err Date: Mon, 10 Oct 2022 21:24:23 +0100 Message-Id: <20221010202423.3221664-1-colin.i.king@gmail.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Variable host_err is assigned a value that is never read, it is being re-assigned a value in every different execution path in the following switch statement. The assignment is redundant and can be removed. Cleans up clang-scan warning: warning: Value stored to 'host_err' is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King --- fs/nfsd/vfs.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index f650afedd67f..5093ae788f53 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -1304,7 +1304,6 @@ nfsd_create_locked(struct svc_rqst *rqstp, struct svc_fh *fhp, iap->ia_mode &= ~current_umask(); err = 0; - host_err = 0; switch (type) { case S_IFREG: host_err = vfs_create(&init_user_ns, dirp, dchild, iap->ia_mode, true); -- 2.37.3