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 <charles.youse@intel.com>
This commit is contained in:
Charles E. Youse 2019-07-04 15:55:49 -07:00 committed by Andrew Boie
commit 58bbbddbef

View file

@ -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;