From: Yuantian.Tang@freescale.com (Tang Yuantian)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ahci: qoriq: Fix a compiling warning
Date: Wed, 14 Oct 2015 16:46:52 +0800 [thread overview]
Message-ID: <1444812412-33321-1-git-send-email-Yuantian.Tang@freescale.com> (raw)
kbuild test robot reports the warnings:
drivers/ata/ahci_qoriq.c: In function 'ahci_qoriq_hardreset':
>> include/asm-generic/io.h:163:2: warning: 'px_is' may be used
>> uninitialized in this function [-Wuninitialized]
drivers/ata/ahci_qoriq.c:70:14: note: 'px_is' was declared here
>> include/asm-generic/io.h:163:2: warning: 'px_cmd' may be used
>> uninitialized in this function [-Wuninitialized]
drivers/ata/ahci_qoriq.c:70:6: note: 'px_cmd' was declared here
This patch fixed it by introducing a local variable.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
I found this warning again on gcc version 4.8.3 20131202.
So this warning may not go way with newer gcc version.
I verified Arnd's suggestion and it works.
So please apply this patch which I sent on behalf of Arnd.
drivers/ata/ahci_qoriq.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/ata/ahci_qoriq.c b/drivers/ata/ahci_qoriq.c
index e5e4988..58c1a94 100644
--- a/drivers/ata/ahci_qoriq.c
+++ b/drivers/ata/ahci_qoriq.c
@@ -76,6 +76,7 @@ static int ahci_qoriq_hardreset(struct ata_link *link, unsigned int *class,
struct ata_taskfile tf;
bool online;
int rc;
+ bool ls1021a_workaround = (qoriq_priv->type == AHCI_LS1021A);
DPRINTK("ENTER\n");
@@ -92,7 +93,7 @@ static int ahci_qoriq_hardreset(struct ata_link *link, unsigned int *class,
* After the sequence is complete, software should restore the
* PxCMD and PxIS with the stored values.
*/
- if (qoriq_priv->type == AHCI_LS1021A) {
+ if (ls1021a_workaround) {
px_cmd = readl(port_mmio + PORT_CMD);
px_is = readl(port_mmio + PORT_IRQ_STAT);
}
@@ -106,7 +107,7 @@ static int ahci_qoriq_hardreset(struct ata_link *link, unsigned int *class,
ahci_check_ready);
/* restore the PxCMD and PxIS on ls1021 */
- if (qoriq_priv->type == AHCI_LS1021A) {
+ if (ls1021a_workaround) {
px_val = readl(port_mmio + PORT_CMD);
if (px_val != px_cmd)
writel(px_cmd, port_mmio + PORT_CMD);
--
2.1.0.27.g96db324
next reply other threads:[~2015-10-14 8:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-14 8:46 Tang Yuantian [this message]
2015-10-15 15:11 ` [PATCH] ahci: qoriq: Fix a compiling warning Tejun Heo
2015-10-15 15:35 ` Arnd Bergmann
2015-10-15 16:04 ` Tejun Heo
2015-10-15 19:42 ` Arnd Bergmann
2015-10-16 2:12 ` Yuantian Tang
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=1444812412-33321-1-git-send-email-Yuantian.Tang@freescale.com \
--to=yuantian.tang@freescale.com \
--cc=linux-arm-kernel@lists.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