diff mbox series

[v2] soc: pxa: ssp: fix casts

Message ID 20240106-pxa-ssp-v2-1-69ac9f028bba@skole.hr (mailing list archive)
State Accepted
Commit 6db359b5eef5de3d5fbf4cb412958186850df106
Headers show
Series [v2] soc: pxa: ssp: fix casts | expand

Commit Message

Duje Mihanović Jan. 6, 2024, 2:11 p.m. UTC
On ARM64 platforms, id->data is a 64-bit value and casting it to a
32-bit integer causes build errors. Cast it to uintptr_t instead.

The id->driver_data cast is unnecessary, so drop it.

Signed-off-by: Duje Mihanović <duje.mihanovic@skole.hr>
---
This patch is necessary for my Marvell PXA1908 series to compile successfully
with allyesconfig:
https://lore.kernel.org/all/20231102-pxa1908-lkml-v7-0-cabb1a0cb52b@skole.hr/

Changes in v2:
- Change first cast to (uintptr_t)
- Drop second cast
- Link to v1: https://lore.kernel.org/20240103210604.16877-1-duje.mihanovic@skole.hr
---
 drivers/soc/pxa/ssp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


---
base-commit: 610a9b8f49fbcf1100716370d3b5f6f884a2835a
change-id: 20240106-pxa-ssp-522745d42418

Best regards,

Comments

Uwe Kleine-König Jan. 6, 2024, 2:32 p.m. UTC | #1
Hello Duje,

On Sat, Jan 06, 2024 at 03:11:33PM +0100, Duje Mihanović wrote:
> On ARM64 platforms, id->data is a 64-bit value and casting it to a
> 32-bit integer causes build errors. Cast it to uintptr_t instead.
> 
> The id->driver_data cast is unnecessary, so drop it.
> 
> Signed-off-by: Duje Mihanović <duje.mihanovic@skole.hr>

Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Thanks
Uwe
patchwork-bot+linux-soc@kernel.org Jan. 9, 2024, 7:40 a.m. UTC | #2
Hello:

This patch was applied to soc/soc.git (for-next)
by Arnd Bergmann <arnd@arndb.de>:

On Sat, 06 Jan 2024 15:11:33 +0100 you wrote:
> On ARM64 platforms, id->data is a 64-bit value and casting it to a
> 32-bit integer causes build errors. Cast it to uintptr_t instead.
> 
> The id->driver_data cast is unnecessary, so drop it.
> 
> Signed-off-by: Duje Mihanović <duje.mihanovic@skole.hr>
> 
> [...]

Here is the summary with links:
  - [v2] soc: pxa: ssp: fix casts
    https://git.kernel.org/soc/soc/c/6db359b5eef5

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/soc/pxa/ssp.c b/drivers/soc/pxa/ssp.c
index a1e8a07f7275..7af04e8b8163 100644
--- a/drivers/soc/pxa/ssp.c
+++ b/drivers/soc/pxa/ssp.c
@@ -152,11 +152,11 @@  static int pxa_ssp_probe(struct platform_device *pdev)
 	if (dev->of_node) {
 		const struct of_device_id *id =
 			of_match_device(of_match_ptr(pxa_ssp_of_ids), dev);
-		ssp->type = (int) id->data;
+		ssp->type = (uintptr_t) id->data;
 	} else {
 		const struct platform_device_id *id =
 			platform_get_device_id(pdev);
-		ssp->type = (int) id->driver_data;
+		ssp->type = id->driver_data;
 
 		/* PXA2xx/3xx SSP ports starts from 1 and the internal pdev->id
 		 * starts from 0, do a translation here