[PATCH 3/5] i386/kexec-mb2-x86.c: cast ints to uintptr_t before pointers to avoid warnings

Ahelenia Ziemiańska nabijaczleweli at nabijaczleweli.xyz
Fri Oct 9 11:39:51 EDT 2020


Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli at nabijaczleweli.xyz>
---
 kexec/arch/i386/kexec-mb2-x86.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kexec/arch/i386/kexec-mb2-x86.c b/kexec/arch/i386/kexec-mb2-x86.c
index 1ad8aed..b4996bc 100644
--- a/kexec/arch/i386/kexec-mb2-x86.c
+++ b/kexec/arch/i386/kexec-mb2-x86.c
@@ -360,13 +360,13 @@ static uint64_t multiboot2_make_mbi(struct kexec_info *info, char *cmdline, int
 	}
 
 out:
-	return (uint64_t) ptrorig;
+	return (uint64_t) (uintptr_t) ptrorig;
 }
 
 static uint64_t multiboot2_mbi_add_module(void *mbi_buf, uint64_t mbi_ptr, uint32_t mod_start,
 					  uint32_t mod_end, char *mod_clp)
 {
-	struct multiboot_tag_module *tag = (struct multiboot_tag_module *) mbi_ptr;
+	struct multiboot_tag_module *tag = (struct multiboot_tag_module *) (uintptr_t) mbi_ptr;
 
 	tag->type = MULTIBOOT_TAG_TYPE_MODULE;
 	tag->size = sizeof(struct multiboot_tag_module) + strlen((char *)(long) mod_clp) + 1;
@@ -381,7 +381,7 @@ static uint64_t multiboot2_mbi_add_module(void *mbi_buf, uint64_t mbi_ptr, uint3
 
 static uint64_t multiboot2_mbi_end(void *mbi_buf, uint64_t mbi_ptr)
 {
-	struct multiboot_tag *tag = (struct multiboot_tag *) mbi_ptr;
+	struct multiboot_tag *tag = (struct multiboot_tag *) (uintptr_t) mbi_ptr;
 
 	tag->type = MULTIBOOT_TAG_TYPE_END;
 	tag->size = sizeof (struct multiboot_tag);
-- 
2.28.0

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/kexec/attachments/20201009/49a8379b/attachment-0001.sig>


More information about the kexec mailing list