Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp486825rwr; Thu, 27 Apr 2023 04:25:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ773B+QFYDXGi7PoC0K/0jiqpTuAPTuDOjMncsM5oo9zJt7+ktA/MC/YtY/jS4Vbg3lhK8e X-Received: by 2002:a17:902:f543:b0:1a6:6edd:d143 with SMTP id h3-20020a170902f54300b001a66eddd143mr1362951plf.6.1682594751143; Thu, 27 Apr 2023 04:25:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682594751; cv=none; d=google.com; s=arc-20160816; b=n0TuMDq+sbU0vC5K3judn4+QjgidO2l+Dx5hZmRisKY7+w3otmQEyim3WrPN4BHHcd bDlzJ3hdYuOY/0hwIZE/Et+V3Xi2sgEXZnhVGpjU7n9y83WTL8HC/YtpkiqE8u4hMxUL rk8i3ozTeUqAKn++YRWaB/Ph30YElrsso9iAGnBnEipYTLd6wHCvBCUyrqOB7zyCout3 GWgkfTqqrSOueFPz6duQ5lWCsNdfQqYjf2QOpjFz2+BGV5yQru1otnoRQQGH/h6oIGlZ zRqCukMTEstJdhPDVba1RkNtyUWwL0pkMje1MAvgwYQANmijy0FowDc2261yXF6ovPQH FCtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature:dkim-signature; bh=WAcni6OXNNhfIsk21LRpOs0ssDNtEseYLnTlcemrY2g=; b=l7fw1Aqt5AW46gz7SvcNOOvdbdvVbS24ypyMSCjJp2L0ly8x2x4C1X6pOzIe3CNzFZ bns9WHdh1h7M8ECNlqQIKewaTxDGyHKpfp3zITreTy233iojsrxDM2kUbjaZKujw0C2c zL55wadbW0+acfZZj1RuWWE0eScSsCyYrBvtMGwPh6k38oMy+aGy5OyQLJtB6znA+IGV /S+7NF91TcjOPDaeYYK3I4Ar1Z8G98Z6a4y6d83TgL0QOp7RKXZ1UP0+Dcy0j1FkeqE1 QiYBvsuq6lVSm9pNNtx/h0mzhr9V96c4VtyPxbylNl2mf/6QkADYPukiklAYK0AFEGRq LmXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codewreck.org header.s=2 header.b="yf/eyQK5"; dkim=pass header.i=@codewreck.org header.s=2 header.b=Wt+7+6xv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=codewreck.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bb1-20020a170902bc8100b001a4ee96c00bsi17715394plb.357.2023.04.27.04.25.38; Thu, 27 Apr 2023 04:25:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@codewreck.org header.s=2 header.b="yf/eyQK5"; dkim=pass header.i=@codewreck.org header.s=2 header.b=Wt+7+6xv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=codewreck.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243699AbjD0LYO (ORCPT + 99 others); Thu, 27 Apr 2023 07:24:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243709AbjD0LYK (ORCPT ); Thu, 27 Apr 2023 07:24:10 -0400 Received: from nautica.notk.org (ipv6.notk.org [IPv6:2001:41d0:1:7a93::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFA9B5BAC; Thu, 27 Apr 2023 04:24:02 -0700 (PDT) Received: by nautica.notk.org (Postfix, from userid 108) id 9D09BC01A; Thu, 27 Apr 2023 13:24:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1682594641; bh=WAcni6OXNNhfIsk21LRpOs0ssDNtEseYLnTlcemrY2g=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=yf/eyQK5ut+JO1qiFPve6ahEGOQVDHwu6RdIhT+iOyUTZQRDCjEZCE3a4iSkr7FOg /LNUJbVSIAjOM1q8bL0ZNB4t0iIoyO6bdkOgNyQb1lrWdgMi47MuaXK0dVMd2nEwAy aCO36BNaRBeSw10lapZsDMb5fv6OuqU1/Rg+V7yogrXOaBTAqH58rr02RuYk+tA4zX P9ide9MQ5zMR6vo56kHkjX4XtgdL01yoeAr6Nr83XwINNNl3s296M4G45j9+jRQtXX x37jnWNUkQ3CfUEij8wlxNCVvBh7trmMit9NoQyGW14Q9fW9ISIJEHp6cm+y0i0VQu FjdMP6gebicZA== X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Received: from odin.codewreck.org (localhost [127.0.0.1]) by nautica.notk.org (Postfix) with ESMTPS id 803C7C027; Thu, 27 Apr 2023 13:23:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1682594640; bh=WAcni6OXNNhfIsk21LRpOs0ssDNtEseYLnTlcemrY2g=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Wt+7+6xvO9HpFj/9+TH6G66Z+k2kv/ZAxBqrO7vZuLcrXeBBpqIPZCrKilnbwH3iL rjxCDHyw3prxovaCXgbDEd+Bg+933sV1tqiur43VXCLZcdLrLZ0KI8JkcHCo4NvQsy ESK9exMRPQkoTeiaOV3JIATVreJr7FbH8Gzy/Ofu0vFOYWSoF4hBwM0V6ie80CFxov C5WIO/y4vCSvBVWwmxDWtrTPyyrmyPpAmWXLj0Zr0U4kcGG+NwaJ3sjbltAHlAVEPZ UBQiNsoEPocMRkY8iIm9fL/Ke7iS5ANVuG0xKXEf+vfvuiGVp3D4Oa9r5SYqcxnljJ 4YqGDXoum1JCA== Received: from [127.0.0.2] (localhost [::1]) by odin.codewreck.org (OpenSMTPD) with ESMTP id 62ba5dfd; Thu, 27 Apr 2023 11:23:38 +0000 (UTC) From: Dominique Martinet Date: Thu, 27 Apr 2023 20:23:37 +0900 Subject: [PATCH 4/5] 9p: virtio: skip incrementing unused variable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230427-scan-build-v1-4-efa05d65e2da@codewreck.org> References: <20230427-scan-build-v1-0-efa05d65e2da@codewreck.org> In-Reply-To: <20230427-scan-build-v1-0-efa05d65e2da@codewreck.org> To: Eric Van Hensbergen , Latchesar Ionkov , Christian Schoenebeck , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Dominique Martinet X-Mailer: b4 0.13-dev-f371f X-Developer-Signature: v=1; a=openpgp-sha256; l=1446; i=asmadeus@codewreck.org; h=from:subject:message-id; bh=ZMF8fKgy6MruQWkvDgsGF7Eu9N0vj7dpVoHPZqEHFx0=; b=owEBbQKS/ZANAwAIAatOm+xqmOZwAcsmYgBkSls6JkS5vYc7mI/MehYXF+/hAVc7drQX7F6Xt Z8djcyEa4CJAjMEAAEIAB0WIQT8g9txgG5a3TOhiE6rTpvsapjmcAUCZEpbOgAKCRCrTpvsapjm cE7lD/45MIokCD08AcJcd9l8YjKbW6ivA5vwiktynC6acsoejS6D6tpmT3ajrzdUNajSO9e+4QH MJq1Xb3Zc4kDZanpyVRsZrtbtkRiaJgCYm4DPzf5AzBiz0LgMpY/Q2cM1Lm0zAfM7aMSSj8ieGh 3ou6Ov9He5CG28Dx32MB5EUbpQb2w5WFZNvJXA0N+25uM2tS2PU0IGYjUGlDakTgp+xrWEMtrph G9kCoT78Zw2LKVVj3817dFqFAoZThsMJLAp8VrMkXVNm8ND63oNtUalPkAiuctQ3v8+j7GmFZQh UzkQqS7g+DHDoNKgBglWyOjyeyE7VtO6XYcHd0hSmQ71aUBko7Fps/8eUtx+YBXQc3ulqg5o06x 3Ull4YF+3FUoWnmY+ShoOCZtYPzjcYXGrPTqJhs9tlSLmcJM+j2Ph8Z0v8iPd2n0yZ/4KOgLxb1 EXhouUqQ32Ov9dY+PWWIavIkVaE52vDzuejOoLTrlQcztNGvAHXhnOZiD7RB09sq9qgvMupOPVG nxP6sS6oTObNmGRgruQzM44Ze2VEgniGpd/7dcCYOwwQt+dJs0EvsqlekArR+Wvx8qq0yquDPO/ UIqf7a8cHvKmXr2oBK4CX9VTCCFFyDqBoucCtzj5boJS25FeS1X/TtqVh3zcMBjCrVVd5lvKIce ZDq4TbS5z4oB6AA== X-Developer-Key: i=asmadeus@codewreck.org; a=openpgp; fpr=B894379F662089525B3FB1B9333F1F391BBBB00A Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the following scan-build warning: net/9p/trans_virtio.c:504:3: warning: Value stored to 'in' is never read [deadcode.DeadStores] in += pack_sg_list_p(chan->sg, out + in, VIRTQUEUE_NUM, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I'm honestly not 100% sure about this one; I'm tempted to think we could (should?) just check the return value of pack_sg_list_p to skip the in_sgs++ and setting sgs[] if it didn't process anything, but I'm not sure it should ever happen so this is probably fine as is. Just removing the assignment at least makes it clear the return value isn't used, so it's an improvement in terms of readability. Signed-off-by: Dominique Martinet --- net/9p/trans_virtio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index f3f678289423..e305071eb7b8 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -501,8 +501,8 @@ p9_virtio_zc_request(struct p9_client *client, struct p9_req_t *req, if (in_pages) { sgs[out_sgs + in_sgs++] = chan->sg + out + in; - in += pack_sg_list_p(chan->sg, out + in, VIRTQUEUE_NUM, - in_pages, in_nr_pages, offs, inlen); + pack_sg_list_p(chan->sg, out + in, VIRTQUEUE_NUM, + in_pages, in_nr_pages, offs, inlen); } BUG_ON(out_sgs + in_sgs > ARRAY_SIZE(sgs)); -- 2.39.2