[U-Boot] [PATCH 22/82] x86: Correct address casts in interrupt code

Simon Glass sjg at chromium.org
Mon Sep 26 05:33:25 CEST 2016


We should cast an address to unsigned long, not u32.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 arch/x86/cpu/interrupts.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/cpu/interrupts.c b/arch/x86/cpu/interrupts.c
index 46babe0..5f6cdd3 100644
--- a/arch/x86/cpu/interrupts.c
+++ b/arch/x86/cpu/interrupts.c
@@ -182,8 +182,8 @@ static inline void load_idt(const struct desc_ptr *dtr)
 
 void set_vector(u8 intnum, void *routine)
 {
-	idt[intnum].base_high = (u16)((u32)(routine) >> 16);
-	idt[intnum].base_low = (u16)((u32)(routine) & 0xffff);
+	idt[intnum].base_high = (u16)((ulong)(routine) >> 16);
+	idt[intnum].base_low = (u16)((ulong)(routine) & 0xffff);
 }
 
 /*
-- 
2.8.0.rc3.226.g39d4020



More information about the U-Boot mailing list