diff mbox series

sh: j2: Use ioremap() to translate device tree address into kernel memory

Message ID 20230503125746.331835-1-glaubitz@physik.fu-berlin.de (mailing list archive)
State New, archived
Headers show
Series sh: j2: Use ioremap() to translate device tree address into kernel memory | expand

Commit Message

John Paul Adrian Glaubitz May 3, 2023, 12:57 p.m. UTC
Addresses the following warning when building j2_defconfig:

arch/sh/kernel/cpu/sh2/probe.c: In function 'scan_cache':
arch/sh/kernel/cpu/sh2/probe.c:24:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   24 |  j2_ccr_base = (u32 __iomem *)of_flat_dt_translate_address(node);
      |

Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
---
 arch/sh/kernel/cpu/sh2/probe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Geert Uytterhoeven May 3, 2023, 1:46 p.m. UTC | #1
On Wed, May 3, 2023 at 2:59 PM John Paul Adrian Glaubitz
<glaubitz@physik.fu-berlin.de> wrote:
> Addresses the following warning when building j2_defconfig:
>
> arch/sh/kernel/cpu/sh2/probe.c: In function 'scan_cache':
> arch/sh/kernel/cpu/sh2/probe.c:24:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>    24 |  j2_ccr_base = (u32 __iomem *)of_flat_dt_translate_address(node);
>       |
>
> Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert
Rob Landley May 5, 2023, 7:30 a.m. UTC | #2
On 5/3/23 07:57, John Paul Adrian Glaubitz wrote:
> Addresses the following warning when building j2_defconfig:

Tested-by: Rob Landley <rob@landley.net>

Rob
diff mbox series

Patch

diff --git a/arch/sh/kernel/cpu/sh2/probe.c b/arch/sh/kernel/cpu/sh2/probe.c
index d342ea08843f..70a07f4f2142 100644
--- a/arch/sh/kernel/cpu/sh2/probe.c
+++ b/arch/sh/kernel/cpu/sh2/probe.c
@@ -21,7 +21,7 @@  static int __init scan_cache(unsigned long node, const char *uname,
 	if (!of_flat_dt_is_compatible(node, "jcore,cache"))
 		return 0;
 
-	j2_ccr_base = (u32 __iomem *)of_flat_dt_translate_address(node);
+	j2_ccr_base = ioremap(of_flat_dt_translate_address(node), 4);
 
 	return 1;
 }