From: Simon Horman <simon.horman@corigine.com>
To: Dominique Martinet <asmadeus@codewreck.org>
Cc: Eric Van Hensbergen <ericvh@gmail.com>,
Latchesar Ionkov <lucho@ionkov.net>,
Christian Schoenebeck <linux_oss@crudebyte.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
v9fs@lists.linux.dev, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org
Subject: Re: [PATCH 5/5] 9p: remove dead stores (variable set again without being read)
Date: Tue, 2 May 2023 17:26:30 +0200 [thread overview]
Message-ID: <ZFErpgo7sq+49H0q@corigine.com> (raw)
In-Reply-To: <20230427-scan-build-v1-5-efa05d65e2da@codewreck.org>
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@codewreck.org>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
prev parent reply other threads:[~2023-05-02 15:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-27 11:23 [PATCH 0/5] Fix scan-build warnings Dominique Martinet
2023-04-27 11:23 ` [PATCH 1/5] 9p: fix ignored return value in v9fs_dir_release Dominique Martinet
2023-05-02 14:46 ` Simon Horman
2023-05-02 23:32 ` Dominique Martinet
2023-05-03 7:17 ` Simon Horman
2023-04-27 11:23 ` [PATCH 2/5] 9p: virtio: fix unlikely null pointer deref in handle_rerror Dominique Martinet
2023-05-02 15:28 ` Simon Horman
2023-04-27 11:23 ` [PATCH 3/5] 9p: virtio: make sure 'offs' is initialized in zc_request Dominique Martinet
2023-05-02 15:27 ` Simon Horman
2023-04-27 11:23 ` [PATCH 4/5] 9p: virtio: skip incrementing unused variable Dominique Martinet
2023-05-02 15:27 ` Simon Horman
2023-04-27 11:23 ` [PATCH 5/5] 9p: remove dead stores (variable set again without being read) Dominique Martinet
2023-05-02 15:26 ` Simon Horman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZFErpgo7sq+49H0q@corigine.com \
--to=simon.horman@corigine.com \
--cc=asmadeus@codewreck.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=ericvh@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux_oss@crudebyte.com \
--cc=lucho@ionkov.net \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=v9fs@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.