software/bios/boot: Fix cast to pointer from integer of different size warnings

On 64-bit:

    litex/soc/software/bios/boot.c: In function 'serialboot':
    litex/soc/software/bios/boot.c:216:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
	 writepointer = (char *) get_uint32(&frame.payload[0]);
			^

When casting from a 32-bit integer to a pointer (32-bit or 64-bit,
depending on the platform), an intermediate cast to "uintptr_t" should
be used to avoid warnings like the above.

Note that using a 32-bit integer is OK, even on 64-bit, as this is
specified by the boot protocol.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
This commit is contained in:
Geert Uytterhoeven 2021-01-19 11:46:40 +01:00
parent 84e3a77724
commit 857ef69b3f
1 changed files with 1 additions and 1 deletions

View File

@ -212,7 +212,7 @@ int serialboot(void)
char *writepointer;
failed = 0;
writepointer = (char *) get_uint32(&frame.payload[0]);
writepointer = (char *)(uintptr_t) get_uint32(&frame.payload[0]);
for(i=4;i<frame.payload_length;i++)
*(writepointer++) = frame.payload[i];
if (frame.cmd == SFL_CMD_LOAD)