All of lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
To: linux-ide@vger.kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>,
	linux-arm-kernel@lists.infradead.org,
	Patrice Chotard <patrice.chotard@foss.st.com>,
	linux-renesas-soc@vger.kernel.org,
	Sergey Shtylyov <s.shtylyov@omp.ru>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>
Subject: [PATCH 2/6] ata: sata_rcar: Fix compilation warning
Date: Mon, 17 Oct 2022 12:22:01 +0900	[thread overview]
Message-ID: <20221017032205.2210188-3-damien.lemoal@opensource.wdc.com> (raw)
In-Reply-To: <20221017032205.2210188-1-damien.lemoal@opensource.wdc.com>

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>
---
 drivers/ata/sata_rcar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
index 590ebea99601..0195eb29f6c2 100644
--- a/drivers/ata/sata_rcar.c
+++ b/drivers/ata/sata_rcar.c
@@ -875,7 +875,7 @@ static int sata_rcar_probe(struct platform_device *pdev)
 	if (!priv)
 		return -ENOMEM;
 
-	priv->type = (enum sata_rcar_type)of_device_get_match_data(dev);
+	priv->type = (unsigned long)of_device_get_match_data(dev);
 
 	pm_runtime_enable(dev);
 	ret = pm_runtime_get_sync(dev);
-- 
2.37.3


WARNING: multiple messages have this Message-ID (diff)
From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
To: linux-ide@vger.kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>,
	linux-arm-kernel@lists.infradead.org,
	Patrice Chotard <patrice.chotard@foss.st.com>,
	linux-renesas-soc@vger.kernel.org,
	Sergey Shtylyov <s.shtylyov@omp.ru>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>
Subject: [PATCH 2/6] ata: sata_rcar: Fix compilation warning
Date: Mon, 17 Oct 2022 12:22:01 +0900	[thread overview]
Message-ID: <20221017032205.2210188-3-damien.lemoal@opensource.wdc.com> (raw)
In-Reply-To: <20221017032205.2210188-1-damien.lemoal@opensource.wdc.com>

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>
---
 drivers/ata/sata_rcar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
index 590ebea99601..0195eb29f6c2 100644
--- a/drivers/ata/sata_rcar.c
+++ b/drivers/ata/sata_rcar.c
@@ -875,7 +875,7 @@ static int sata_rcar_probe(struct platform_device *pdev)
 	if (!priv)
 		return -ENOMEM;
 
-	priv->type = (enum sata_rcar_type)of_device_get_match_data(dev);
+	priv->type = (unsigned long)of_device_get_match_data(dev);
 
 	pm_runtime_enable(dev);
 	ret = pm_runtime_get_sync(dev);
-- 
2.37.3


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2022-10-17  3:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-17  3:21 [PATCH 0/6] Fix compilation warnings Damien Le Moal
2022-10-17  3:21 ` Damien Le Moal
2022-10-17  3:22 ` [PATCH 1/6] ata: ahci_st: Fix compilation warning Damien Le Moal
2022-10-17  3:22   ` Damien Le Moal
2022-10-17  3:22 ` Damien Le Moal [this message]
2022-10-17  3:22   ` [PATCH 2/6] ata: sata_rcar: " Damien Le Moal
2022-10-17  7:13   ` Geert Uytterhoeven
2022-10-17  7:13     ` Geert Uytterhoeven
2022-10-17 19:08   ` Sergey Shtylyov
2022-10-17 19:08     ` Sergey Shtylyov
2022-10-17  3:22 ` [PATCH 3/6] ata: ahci_brcm: " Damien Le Moal
2022-10-17  3:22   ` Damien Le Moal
2022-10-17 19:57   ` Florian Fainelli
2022-10-17 19:57     ` Florian Fainelli
2022-10-17  3:22 ` [PATCH 4/6] ata: ahci_xgene: " Damien Le Moal
2022-10-17  3:22   ` Damien Le Moal
2022-10-17  3:22 ` [PATCH 5/6] ata: ahci_imx: " Damien Le Moal
2022-10-17  3:22   ` Damien Le Moal
2022-10-17  3:22 ` [PATCH 6/6] ata: ahci_qoriq: " Damien Le Moal
2022-10-17  3:22   ` Damien Le Moal
2022-10-17  7:25 ` [PATCH 0/6] Fix compilation warnings Arnd Bergmann
2022-10-17  7:25   ` Arnd Bergmann

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=20221017032205.2210188-3-damien.lemoal@opensource.wdc.com \
    --to=damien.lemoal@opensource.wdc.com \
    --cc=arnd@arndb.de \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=patrice.chotard@foss.st.com \
    --cc=s.hauer@pengutronix.de \
    --cc=s.shtylyov@omp.ru \
    --cc=shawnguo@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.