mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next] phy: amlogic: meson-g12a-usb2: fix Wvoid-pointer-to-enum-cast warning
@ 2023-08-10  9:13 Krzysztof Kozlowski
  2023-08-14  7:43 ` Neil Armstrong
  2023-08-17  9:55 ` Vinod Koul
  0 siblings, 2 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-10  9:13 UTC (permalink / raw)
  To: Vinod Koul, Kishon Vijay Abraham I, Neil Armstrong, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl, linux-phy, linux-arm-kernel,
	linux-amlogic, linux-kernel
  Cc: Andi Shyti, Krzysztof Kozlowski

'soc_id' is an enum, thus cast of pointer on 64-bit compile test with
W=1 causes:

  phy-meson-g12a-usb2.c:322:17: error: cast to smaller integer type 'enum meson_soc_id' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/phy/amlogic/phy-meson-g12a-usb2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/amlogic/phy-meson-g12a-usb2.c b/drivers/phy/amlogic/phy-meson-g12a-usb2.c
index a628c59e5cf0..0e0b5c00b676 100644
--- a/drivers/phy/amlogic/phy-meson-g12a-usb2.c
+++ b/drivers/phy/amlogic/phy-meson-g12a-usb2.c
@@ -319,7 +319,7 @@ static int phy_meson_g12a_usb2_probe(struct platform_device *pdev)
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 
-	priv->soc_id = (enum meson_soc_id)of_device_get_match_data(&pdev->dev);
+	priv->soc_id = (uintptr_t)of_device_get_match_data(&pdev->dev);
 
 	priv->regmap = devm_regmap_init_mmio(dev, base,
 					     &phy_meson_g12a_usb2_regmap_conf);
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] phy: amlogic: meson-g12a-usb2: fix Wvoid-pointer-to-enum-cast warning
  2023-08-10  9:13 [PATCH net-next] phy: amlogic: meson-g12a-usb2: fix Wvoid-pointer-to-enum-cast warning Krzysztof Kozlowski
@ 2023-08-14  7:43 ` Neil Armstrong
  2023-08-14  7:45   ` Krzysztof Kozlowski
  2023-08-17  9:55 ` Vinod Koul
  1 sibling, 1 reply; 4+ messages in thread
From: Neil Armstrong @ 2023-08-14  7:43 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Vinod Koul, Kishon Vijay Abraham I,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, linux-phy,
	linux-arm-kernel, linux-amlogic, linux-kernel
  Cc: Andi Shyti

On 10/08/2023 11:13, Krzysztof Kozlowski wrote:
> 'soc_id' is an enum, thus cast of pointer on 64-bit compile test with
> W=1 causes:
> 
>    phy-meson-g12a-usb2.c:322:17: error: cast to smaller integer type 'enum meson_soc_id' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>   drivers/phy/amlogic/phy-meson-g12a-usb2.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/phy/amlogic/phy-meson-g12a-usb2.c b/drivers/phy/amlogic/phy-meson-g12a-usb2.c
> index a628c59e5cf0..0e0b5c00b676 100644
> --- a/drivers/phy/amlogic/phy-meson-g12a-usb2.c
> +++ b/drivers/phy/amlogic/phy-meson-g12a-usb2.c
> @@ -319,7 +319,7 @@ static int phy_meson_g12a_usb2_probe(struct platform_device *pdev)
>   	if (IS_ERR(base))
>   		return PTR_ERR(base);
>   
> -	priv->soc_id = (enum meson_soc_id)of_device_get_match_data(&pdev->dev);
> +	priv->soc_id = (uintptr_t)of_device_get_match_data(&pdev->dev);
>   
>   	priv->regmap = devm_regmap_init_mmio(dev, base,
>   					     &phy_meson_g12a_usb2_regmap_conf);

I believe the net-next is wrong here, but whatever:

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] phy: amlogic: meson-g12a-usb2: fix Wvoid-pointer-to-enum-cast warning
  2023-08-14  7:43 ` Neil Armstrong
@ 2023-08-14  7:45   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-14  7:45 UTC (permalink / raw)
  To: neil.armstrong, Vinod Koul, Kishon Vijay Abraham I, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl, linux-phy, linux-arm-kernel,
	linux-amlogic, linux-kernel
  Cc: Andi Shyti

On 14/08/2023 09:43, Neil Armstrong wrote:
> On 10/08/2023 11:13, Krzysztof Kozlowski wrote:
>> 'soc_id' is an enum, thus cast of pointer on 64-bit compile test with
>> W=1 causes:
>>
>>    phy-meson-g12a-usb2.c:322:17: error: cast to smaller integer type 'enum meson_soc_id' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> ---
>>   drivers/phy/amlogic/phy-meson-g12a-usb2.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/phy/amlogic/phy-meson-g12a-usb2.c b/drivers/phy/amlogic/phy-meson-g12a-usb2.c
>> index a628c59e5cf0..0e0b5c00b676 100644
>> --- a/drivers/phy/amlogic/phy-meson-g12a-usb2.c
>> +++ b/drivers/phy/amlogic/phy-meson-g12a-usb2.c
>> @@ -319,7 +319,7 @@ static int phy_meson_g12a_usb2_probe(struct platform_device *pdev)
>>   	if (IS_ERR(base))
>>   		return PTR_ERR(base);
>>   
>> -	priv->soc_id = (enum meson_soc_id)of_device_get_match_data(&pdev->dev);
>> +	priv->soc_id = (uintptr_t)of_device_get_match_data(&pdev->dev);
>>   
>>   	priv->regmap = devm_regmap_init_mmio(dev, base,
>>   					     &phy_meson_g12a_usb2_regmap_conf);
> 
> I believe the net-next is wrong here, but whatever:

Yes, it's a history-copy-paste mistake.

> 
> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

Thanks.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] phy: amlogic: meson-g12a-usb2: fix Wvoid-pointer-to-enum-cast warning
  2023-08-10  9:13 [PATCH net-next] phy: amlogic: meson-g12a-usb2: fix Wvoid-pointer-to-enum-cast warning Krzysztof Kozlowski
  2023-08-14  7:43 ` Neil Armstrong
@ 2023-08-17  9:55 ` Vinod Koul
  1 sibling, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2023-08-17  9:55 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Neil Armstrong, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl, linux-phy, linux-arm-kernel,
	linux-amlogic, linux-kernel, Krzysztof Kozlowski
  Cc: Andi Shyti


On Thu, 10 Aug 2023 11:13:10 +0200, Krzysztof Kozlowski wrote:
> 'soc_id' is an enum, thus cast of pointer on 64-bit compile test with
> W=1 causes:
> 
>   phy-meson-g12a-usb2.c:322:17: error: cast to smaller integer type 'enum meson_soc_id' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]
> 
> 

Applied, thanks!

[1/1] phy: amlogic: meson-g12a-usb2: fix Wvoid-pointer-to-enum-cast warning
      commit: b72d87b4cb67984419502eb7c16adfea48cc56aa

Best regards,
-- 
~Vinod



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-17  9:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-10  9:13 [PATCH net-next] phy: amlogic: meson-g12a-usb2: fix Wvoid-pointer-to-enum-cast warning Krzysztof Kozlowski
2023-08-14  7:43 ` Neil Armstrong
2023-08-14  7:45   ` Krzysztof Kozlowski
2023-08-17  9:55 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®