From 58bbbddbef19d0022350685518b626df6e78dd1d Mon Sep 17 00:00:00 2001 From: "Charles E. Youse" Date: Thu, 4 Jul 2019 15:55:49 -0700 Subject: [PATCH] arch/x86: fix multiboot.c pointer cast Widen the integer to pointer size before conversion, to make explicit the intent (and silence the compiler warning). Also fix a minor bug involving a duplicate (and thus dead) store. Signed-off-by: Charles E. Youse --- arch/x86/core/multiboot.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/core/multiboot.c b/arch/x86/core/multiboot.c index 99de3e62060..b9ef14ecf9d 100644 --- a/arch/x86/core/multiboot.c +++ b/arch/x86/core/multiboot.c @@ -41,11 +41,10 @@ static int multiboot_framebuf_init(struct device *dev) adj_x = info->fb_width - CONFIG_X86_MULTIBOOT_FRAMEBUF_X; adj_y = info->fb_height - CONFIG_X86_MULTIBOOT_FRAMEBUF_Y; - buffer = (uint32_t *) info->fb_addr_lo; data->pitch = (info->fb_pitch / 4) + adj_x; adj_x /= 2; adj_y /= 2; - buffer = (uint32_t *) info->fb_addr_lo; + buffer = (uint32_t *) (uintptr_t) info->fb_addr_lo; buffer += adj_x; buffer += adj_y * data->pitch; data->buffer = buffer;