Re: [PATCH] sh: pgtable-3level: Fix cast to pointer from integer of different size

From: Rob Landley
Date: Thu Sep 16 2021 - 21:13:07 EST


On 9/15/21 8:50 AM, Geert Uytterhoeven wrote:
> arch/sh/include/asm/pgtable-3level.h:37:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
...
> The truncation to "unsigned long" has been there since forever, so
> probably it still works fine ;-)

1) Linux is LP64 so sizeof(long) and sizeof(pointer) always match, so it's not
truncating.

2) The sh5 only ever shipped evaluation units, it never had a production run,
and we haven't implemented j64 yet, so all superh targets are currently 32 bit.
(I.E. it's complaining about _expanding_ the pointer, which shouldn't be a
problem as long as endianness is respected.)

Rob