From: Arnd Bergmann <arnd@arndb.de>
To: Fengguang Wu <fengguang.wu@intel.com>
Cc: Yuantian Tang <Yuantian.Tang@freescale.com>,
Tejun Heo <tj@kernel.org>,
"hdegoede@redhat.com" <hdegoede@redhat.com>,
"linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH] ahci: qoriq: fixed using uninitialized variable warnings
Date: Mon, 14 Sep 2015 09:45:33 +0200 [thread overview]
Message-ID: <4524877.YJljz8o2LZ@wuerfel> (raw)
In-Reply-To: <20150914065432.GA25168@wfg-t540p.sh.intel.com>
On Monday 14 September 2015 14:54:32 Fengguang Wu wrote:
> On Mon, Sep 14, 2015 at 06:51:36AM +0000, Yuantian Tang wrote:
> > The ARCH should have been ARM for this driver.
> > Do you think this warning would go away if adding a dependency on ARM?
>
> Yes, that may work.
In general, we really want to leave drivers with a COMPILE_TEST dependency
so they at least get cross-built on x86, ideally on all architectures.
Does something like the below help? I think we really just need to help
gcc a little to see the obvious.
Arnd
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
diff --git a/drivers/ata/ahci_qoriq.c b/drivers/ata/ahci_qoriq.c
index e5e498812554..fc57208d8dcd 100644
--- a/drivers/ata/ahci_qoriq.c
+++ b/drivers/ata/ahci_qoriq.c
@@ -75,6 +75,7 @@ static int ahci_qoriq_hardreset(struct ata_link *link, unsigned int *class,
u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG;
struct ata_taskfile tf;
bool online;
+ bool ls101021a_workaround = (qoriq_priv->type == AHCI_LS1021A);
int rc;
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 (ls101021a_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 (ls101021a_workaround) {
px_val = readl(port_mmio + PORT_CMD);
if (px_val != px_cmd)
writel(px_cmd, port_mmio + PORT_CMD);
next prev parent reply other threads:[~2015-09-14 7:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-09 9:16 [PATCH] ahci: qoriq: fixed using uninitialized variable warnings Yuantian.Tang
2015-09-09 10:57 ` Hans de Goede
2015-09-09 14:01 ` Tejun Heo
2015-09-10 6:17 ` Yuantian Tang
2015-09-11 5:27 ` Yuantian Tang
2015-09-11 13:54 ` Tejun Heo
2015-09-14 3:02 ` Yuantian Tang
2015-09-14 4:04 ` Fengguang Wu
2015-09-14 6:51 ` Yuantian Tang
2015-09-14 6:54 ` Fengguang Wu
2015-09-14 7:45 ` Arnd Bergmann [this message]
2015-09-14 16:00 ` Tejun Heo
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=4524877.YJljz8o2LZ@wuerfel \
--to=arnd@arndb.de \
--cc=Yuantian.Tang@freescale.com \
--cc=devicetree@vger.kernel.org \
--cc=fengguang.wu@intel.com \
--cc=hdegoede@redhat.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.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