diff mbox

sata_rcar: fix compilation warning in sata_rcar_thaw()

Message ID 201306032219.59210.sergei.shtylyov@cogentembedded.com
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

Sergei Shtylyov June 3, 2013, 6:19 p.m. UTC
When compiling the driver with gcc 4.8, it gives the following warning:

drivers/ata/sata_rcar.c: In function `sata_rcar_thaw':
drivers/ata/sata_rcar.c:183:2: warning: large integer implicitly truncated to
unsigned type [-Woverflow]

Fix the warning by explicit cast of the 'unsigned long' value to 'u32'.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
This patch is against 'for-3.10-fixes' branch of Tejun Heo's 'libata.git' repo.
Tejun, does it fix the warning for you?

 drivers/ata/sata_rcar.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

Comments

Tejun Heo June 3, 2013, 8:17 p.m. UTC | #1
On Mon, Jun 03, 2013 at 10:19:58PM +0400, Sergei Shtylyov wrote:
> When compiling the driver with gcc 4.8, it gives the following warning:
> 
> drivers/ata/sata_rcar.c: In function `sata_rcar_thaw':
> drivers/ata/sata_rcar.c:183:2: warning: large integer implicitly truncated to
> unsigned type [-Woverflow]
> 
> Fix the warning by explicit cast of the 'unsigned long' value to 'u32'.
> 
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Applied to libata/for-3.11.  Thanks.
diff mbox

Patch

Index: libata/drivers/ata/sata_rcar.c
===================================================================
--- libata.orig/drivers/ata/sata_rcar.c
+++ libata/drivers/ata/sata_rcar.c
@@ -180,7 +180,7 @@  static void sata_rcar_thaw(struct ata_po
 	struct sata_rcar_priv *priv = ap->host->private_data;
 
 	/* ack */
-	iowrite32(~SATA_RCAR_INT_MASK, priv->base + SATAINTSTAT_REG);
+	iowrite32(~(u32)SATA_RCAR_INT_MASK, priv->base + SATAINTSTAT_REG);
 
 	ata_sff_thaw(ap);