Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp512128rwr; Wed, 3 May 2023 01:57:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4sL6QrECcGfakmbg0qAvUPfK1IUoJEkYHn+AM9yNxc0o6ALzpwBzPljl+uqiq0zIjeRabb X-Received: by 2002:a17:902:d507:b0:1aa:fe40:6f96 with SMTP id b7-20020a170902d50700b001aafe406f96mr1673000plg.23.1683104250657; Wed, 03 May 2023 01:57:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683104250; cv=none; d=google.com; s=arc-20160816; b=O2cU4bV8EHcScy0OhM1xaRobQZ9Bf7P6e/ps4OKGoaqKtRbofqtzsShPJViX8un2Yf lGe52uKpCj/tot6tNfKUq4hV1fAzH60Q+ERr6wq0lRVCnZ/a/qC5vNtmNSpKD/sqIMvh V9audVRwwhebWoqm/zt43MJqL0pcnqFeWol7QVc1JgevU+VTQbl5WywxZHKjIPnhYuFu fzXi/7ehpirwt7oTcXUaQzK01N1A01pjDZoqgkequ6BjhoVzDbznXyTw7cShuOO0sbSl hw8tLe6YUAEPO+4Y0OdSpW/XJilmQDNd0yNJPb0tQ0SJo632splPSviN/0KlYLIv185P +ZdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=rDa2GFnRyj0u/PaMCdh8MXpYEbFGmlro85sNxPD/eVM=; b=yexPVTfM/NAwXy0WcaQZevcNdL0WOiavnDFwgFcsD7lHKiqxXBRJdhcdJQ38loWGvC UdYdHYkLrfZqEx9AmASK9tNftWVGMjmvkC6yBFSnxLZYNtrrqeHjxGLsxF+bY85SJN16 611ZkPiS8d1HB4AeYo3qNsvjHbguiPAl1+aesVpiaGqCKXlx3bd0XU+YZskQE70ROKp/ AWENDQADvHHQMSu9XzYnqEmkwXrxeckcsTdrcw0ZQiPIUVLCpCtqB1dhiqQwyaSOXtRA KYo1mpupPE+QJ1VKuUZa6w1IuIuLAyBccuufnveL0tC3MxDY+MNw1Xg93ClCep2CTg8r l/Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codewreck.org header.s=2 header.b=ElKdUtHV; dkim=pass header.i=@codewreck.org header.s=2 header.b=ElKdUtHV; 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 l6-20020a170903244600b0019a95ab6b4esi35139755pls.407.2023.05.03.01.57.14; Wed, 03 May 2023 01:57:30 -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=ElKdUtHV; dkim=pass header.i=@codewreck.org header.s=2 header.b=ElKdUtHV; 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 S229805AbjECIpB (ORCPT + 99 others); Wed, 3 May 2023 04:45:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229820AbjECIoy (ORCPT ); Wed, 3 May 2023 04:44:54 -0400 Received: from nautica.notk.org (ipv6.notk.org [IPv6:2001:41d0:1:7a93::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EA803C29; Wed, 3 May 2023 01:44:53 -0700 (PDT) Received: by nautica.notk.org (Postfix, from userid 108) id E3E60C022; Wed, 3 May 2023 10:44:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1683103491; bh=rDa2GFnRyj0u/PaMCdh8MXpYEbFGmlro85sNxPD/eVM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ElKdUtHVBCkVeQSbl+UNy6iaV1G4VhujQF22VhlaRZKhI6A1qMjrS5JMnEX0ozFL5 oQ/8GB7uqhqj7bJmGOxZoA+ARDkOD19Gs8CA8mQULrJUknNj+RP1lNRiNhu5ANfnBk 4PytgsK0Mfk470n1LCZdhzWCdR8rvN8VgbtHFoIvGY4WYpN1xlIOJI31R6L7ZSKFAG FumSILzqCE7T/Bea0UbpgOCwMsR2IF6deW41oEnjLHiU2BGeIMR7WiVuFd85QG7POf fPYOsG5bzYFoX6l08ftQlE4W/GALROmpTr7S63Jij3ro1AtzmeLvts4KRTWyp2Nyi1 A2JhqJBDGoKAg== 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,URIBL_BLOCKED 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 CC6A4C009; Wed, 3 May 2023 10:44:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1683103491; bh=rDa2GFnRyj0u/PaMCdh8MXpYEbFGmlro85sNxPD/eVM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ElKdUtHVBCkVeQSbl+UNy6iaV1G4VhujQF22VhlaRZKhI6A1qMjrS5JMnEX0ozFL5 oQ/8GB7uqhqj7bJmGOxZoA+ARDkOD19Gs8CA8mQULrJUknNj+RP1lNRiNhu5ANfnBk 4PytgsK0Mfk470n1LCZdhzWCdR8rvN8VgbtHFoIvGY4WYpN1xlIOJI31R6L7ZSKFAG FumSILzqCE7T/Bea0UbpgOCwMsR2IF6deW41oEnjLHiU2BGeIMR7WiVuFd85QG7POf fPYOsG5bzYFoX6l08ftQlE4W/GALROmpTr7S63Jij3ro1AtzmeLvts4KRTWyp2Nyi1 A2JhqJBDGoKAg== Received: from localhost (odin.codewreck.org [local]) by odin.codewreck.org (OpenSMTPD) with ESMTPA id ecff0b1d; Wed, 3 May 2023 08:44:44 +0000 (UTC) Date: Wed, 3 May 2023 17:44:29 +0900 From: Dominique Martinet To: Christian Schoenebeck Cc: Eric Van Hensbergen , Latchesar Ionkov , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH v2 5/5] 9p: remove dead stores (variable set again without being read) Message-ID: References: <20230427-scan-build-v2-0-bb96a6e6a33b@codewreck.org> <20230427-scan-build-v2-5-bb96a6e6a33b@codewreck.org> <3207385.lLoMtQYYpd@silver> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <3207385.lLoMtQYYpd@silver> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christian Schoenebeck wrote on Wed, May 03, 2023 at 10:22:46AM +0200: > On Wednesday, May 3, 2023 9:49:29 AM CEST Dominique Martinet wrote: > > The 9p code for some reason used to initialize variables outside of the > > declaration, e.g. instead of just initializing the variable like this: > > > > int retval = 0 > > > > We would be doing this: > > > > int retval; > > retval = 0; > > OK, but AFAICS this patch would simply remove all initializations. I would > expect at least a default initialization at variable declaration instead. Yes, clang doesn't seem to complain about 'int reval = 0' so the patch can just be updated to do that instead; I just removed them because the sheer number made it faster to do that. Happy to drop this last patch for now and rework it when time permits. > > This is perfectly fine and the compiler will just optimize dead stores > > anyway, but scan-build seems to think this is a problem and there are > > many of these warnings making the output of scan-build full of such > > warnings: > > fs/9p/vfs_inode.c:916:2: warning: Value stored to 'retval' is never read [deadcode.DeadStores] > > retval = 0; > > ^ ~ > > Honestly I don't see much value in this warning. Can't we just disable this > warning for 9p code or is this just controllable for the entire project? Dead stores in itself is a useful warning, it's what found the real bug where return value was lost in patch 1 of this series, I don't think we should just disable the warning. -- Dominique Martinet | Asmadeus