From: Dan Carpenter <dan.carpenter@oracle.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Colin King <colin.king@canonical.com>,
"James E . J . Bottomley" <jejb@linux.ibm.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scsi: sym53c8xx_2: remove redundant assignment to retv
Date: Tue, 13 Aug 2019 16:14:20 +0300 [thread overview]
Message-ID: <20190813131420.GS1974@kadam> (raw)
In-Reply-To: <20190809181733.GQ5482@bombadil.infradead.org>
On Fri, Aug 09, 2019 at 11:17:33AM -0700, Matthew Wilcox wrote:
> On Fri, Aug 09, 2019 at 06:59:32PM +0100, Colin King wrote:
> > Variable retv is initialized to a value that is never read and it
> > is re-assigned later. The initialization is redundant and can be
> > removed.
>
> Acked-by: Matthew Wilcox (Oracle) <willy@infradead.org>
>
> Seems like a bit of a pointless class of warnings, given that gcc now
> initialises all locals. But I'm happy for James or Martin to pick it up.
GCC doesn't initialize all locals. Just some depending on the
optimization level. It's related to a bug that's several years old.
This warning does find some bugs. The common one is where people forget
to check the return.
ret = something();
// blank line here indicates that ret is never checked again.
regards,
dan carpenter
next prev parent reply other threads:[~2019-08-13 13:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-09 17:59 [PATCH] scsi: sym53c8xx_2: remove redundant assignment to retv Colin King
2019-08-09 18:17 ` Matthew Wilcox
2019-08-13 13:14 ` Dan Carpenter [this message]
2019-08-13 1:58 ` Martin K. Petersen
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=20190813131420.GS1974@kadam \
--to=dan.carpenter@oracle.com \
--cc=colin.king@canonical.com \
--cc=jejb@linux.ibm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=willy@infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox