diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-05-29 17:12:39 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-05-31 16:10:46 +0200 |
commit | 33de6b57a82a70a5b1e6991d0eb459f5c49578f9 (patch) | |
tree | 8b251c905c686d3f3ba178fbc8c74bd49168a64b /src/boot/efi/linux.c | |
parent | f3794366b07262ca213c63b61361e15647cfafda (diff) | |
download | systemd-33de6b57a82a70a5b1e6991d0eb459f5c49578f9.tar.gz |
efi: explicitly cast physical address to UINTN when converting to/from pointers
UINTN is the integer type equalling the native ptr size. Let's fix the
casting warnings described in #7788 by casting the the pointers and
values to this type first. That way we cast integers to the right size
first before turning them into pointers, and pointers are first
covnerted to integers of the right size before converting them into
integers.
Not tested, since I lack i386 EFI systems, but I think this is simple
enough to be correct event without testing.
Fixes: #7788
Diffstat (limited to 'src/boot/efi/linux.c')
-rw-r--r-- | src/boot/efi/linux.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/boot/efi/linux.c b/src/boot/efi/linux.c index e8f7651324..1f81f3e771 100644 --- a/src/boot/efi/linux.c +++ b/src/boot/efi/linux.c @@ -128,7 +128,7 @@ EFI_STATUS linux_exec(EFI_HANDLE *image, if (EFI_ERROR(err)) return err; CopyMem((VOID *)(UINTN)addr, cmdline, cmdline_len); - ((CHAR8 *)addr)[cmdline_len] = 0; + ((CHAR8 *)(UINTN)addr)[cmdline_len] = 0; boot_setup->cmd_line_ptr = (UINT32)addr; } |