Skip to content

Commit 0ffac47

Browse files
author
Damien Le Moal
committed
ata: sata_rcar: Fix compilation warning
When compiling with clang and W=1, the following warning is generated: drivers/ata/sata_rcar.c:878:15: error: cast to smaller integer type 'enum sata_rcar_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] priv->type = (enum sata_rcar_type)of_device_get_match_data(dev); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix this by using a cast to unsigned long to match the "void *" type size returned by of_device_get_match_data(). Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
1 parent 17cc1ee commit 0ffac47

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/ata/sata_rcar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ static int sata_rcar_probe(struct platform_device *pdev)
875875
if (!priv)
876876
return -ENOMEM;
877877

878-
priv->type = (enum sata_rcar_type)of_device_get_match_data(dev);
878+
priv->type = (unsigned long)of_device_get_match_data(dev);
879879

880880
pm_runtime_enable(dev);
881881
ret = pm_runtime_get_sync(dev);

0 commit comments

Comments
 (0)