diff mbox

ahci: qoriq: Fix a compiling warning

Message ID 1444812412-33321-1-git-send-email-Yuantian.Tang@freescale.com
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

tang yuantian Oct. 14, 2015, 8:46 a.m. UTC
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(-)

Comments

Tejun Heo Oct. 15, 2015, 3:11 p.m. UTC | #1
Hello,

On Wed, Oct 14, 2015 at 04:46:52PM +0800, Tang Yuantian wrote:
> 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>

Hmmm... why is the patch signed off by Arnd?  You can't sign off for
other people.  If this was suggested by Arnd, please use
"Suggested-by:" or "Original-patch-by:".

Thanks.
Arnd Bergmann Oct. 15, 2015, 3:35 p.m. UTC | #2
On Thursday 15 October 2015 11:11:52 Tejun Heo wrote:
> 
> On Wed, Oct 14, 2015 at 04:46:52PM +0800, Tang Yuantian wrote:
> > 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>
> 
> Hmmm... why is the patch signed off by Arnd?  You can't sign off for
> other people.  If this was suggested by Arnd, please use
> "Suggested-by:" or "Original-patch-by:".

The original patch I sent had my Signed-off-by, see
https://lkml.org/lkml/2015/9/14/64

Tang Yuantian now submitted it properly with a full changelog text
but forgot to add the 'From: Arnd Bergmann <arnd@arndb.de>' line at
the start and the second Signed-off-by below mine.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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);