diff mbox

[v2] ata: libahci: Silence compiler warning on 64-bit

Message ID 1406903437-13995-1-git-send-email-thierry.reding@gmail.com
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

Thierry Reding Aug. 1, 2014, 2:30 p.m. UTC
From: Thierry Reding <treding@nvidia.com>

Commit 725c7b570fda (ata: libahci_platform: move port_map parameters
into the AHCI structure) moves flags into the struct ahci_host_priv's
.flags field, which causes compiler warnings on 64-bit builds when that
value is cast to a void * pointer. Cast to an unsigned long so that the
subsequent cast to a pointer doesn't produce a warning.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
Changes in v2:
- cast unsigned int to unsigned long to avoid the compiler warning and
  keep the flags field's type as-is

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

Comments

Tejun Heo Aug. 1, 2014, 3:19 p.m. UTC | #1
On Fri, Aug 01, 2014 at 04:30:37PM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> Commit 725c7b570fda (ata: libahci_platform: move port_map parameters
> into the AHCI structure) moves flags into the struct ahci_host_priv's
> .flags field, which causes compiler warnings on 64-bit builds when that
> value is cast to a void * pointer. Cast to an unsigned long so that the
> subsequent cast to a pointer doesn't produce a warning.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>

Applied to libata/for-3.17.

Thanks!
diff mbox

Patch

diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
index a60b8cd40198..5b92c290e6c6 100644
--- a/drivers/ata/libahci_platform.c
+++ b/drivers/ata/libahci_platform.c
@@ -426,7 +426,7 @@  int ahci_platform_init_host(struct platform_device *pdev,
 	}
 
 	/* prepare host */
-	pi.private_data = (void *)hpriv->flags;
+	pi.private_data = (void *)(unsigned long)hpriv->flags;
 
 	ahci_save_initial_config(dev, hpriv);