[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZFErpgo7sq+49H0q@corigine.com>
Date: Tue, 2 May 2023 17:26:30 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Dominique Martinet <asmadeus@...ewreck.org>
Cc: Eric Van Hensbergen <ericvh@...il.com>,
Latchesar Ionkov <lucho@...kov.net>,
Christian Schoenebeck <linux_oss@...debyte.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, v9fs@...ts.linux.dev,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH 5/5] 9p: remove dead stores (variable set again without
being read)
On Thu, Apr 27, 2023 at 08:23:38PM +0900, 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;
>
> 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;
> ^ ~
>
> I have no strong opinion here, but if we want to regularily run
s/regularily/regularly/
> scan-build we should fix these just to silence the messages.
>
> I've confirmed these all are indeed ok to remove.
Likewise, these look good to me.
> Signed-off-by: Dominique Martinet <asmadeus@...ewreck.org>
Reviewed-by: Simon Horman <simon.horman@...igine.com>
Powered by blists - more mailing lists