Thread (26 messages) 26 messages, 5 authors, 2024-07-02

Re: [PATCH v2 2/3] net: stmmac: Add interconnect support

From: Andrew Lunn <andrew@lunn.ch>
Date: 2024-06-27 00:13:18
Also in: linux-arm-kernel, linux-arm-msm, linux-devicetree, lkml

On Wed, Jun 26, 2024 at 04:36:06PM -0700, Sagar Cheluvegowda wrote:

On 6/26/2024 6:07 AM, Andrew Lunn wrote:
quoted
quoted
+	plat->axi_icc_path = devm_of_icc_get(&pdev->dev, "axi");
+	if (IS_ERR(plat->axi_icc_path)) {
+		ret = (void *)plat->axi_icc_path;
Casting	to a void * seems odd. ERR_PTR()?

	Andrew
The output of devm_of_icc_get is a pointer of type icc_path,
i am getting below warning when i try to ERR_PTR instead of Void*
as ERR_PTR will try to convert a long integer to a Void*.

"warning: passing argument 1 of ‘ERR_PTR’ makes integer from pointer without a cast"
https://elixir.bootlin.com/linux/v6.10-rc5/source/drivers/crypto/qce/core.c#L224
https://elixir.bootlin.com/linux/v6.10-rc5/source/drivers/gpu/drm/msm/adreno/a3xx_gpu.c#L591
https://elixir.bootlin.com/linux/v6.10-rc5/source/drivers/gpu/drm/msm/adreno/a3xx_gpu.c#L597
https://elixir.bootlin.com/linux/v6.10-rc5/source/drivers/spi/spi-qup.c#L1052

Sorry, PTR_ERR().

In general, a cast to a void * is a red flag and will get looked
at. It is generally wrong. So you might want to fixup where ever you
copied this from.

	Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help