aboutsummaryrefslogtreecommitdiff
path: root/src/northbridge/intel/haswell/gma.c
diff options
context:
space:
mode:
authorRyan Salsamendi <rsalsamendi@hotmail.com>2017-06-30 17:29:37 -0700
committerNico Huber <nico.h@gmx.de>2017-07-03 10:33:16 +0000
commitfa0725dead0fdc7e9330e77c42ff4ed4b36a89c4 (patch)
tree95f4af78e21bf1e8a07ab6d27d0224206721c406 /src/northbridge/intel/haswell/gma.c
parent889ce9c91ecabb40f079111b22124560c55be4e6 (diff)
northbridge/intel/haswell: Fix undefined behavior
Fix reports found by undefined behavior sanitizer. Left shifting an int where the right operand is >= the width of the type is undefined. Add UL suffix since it's safe for unsigned types. Change-Id: If2d34e4f05494c17bf9b9dec113b8f6863214e56 Signed-off-by: Ryan Salsamendi <rsalsamendi@hotmail.com> Reviewed-on: https://review.coreboot.org/20447 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/northbridge/intel/haswell/gma.c')
-rw-r--r--src/northbridge/intel/haswell/gma.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/northbridge/intel/haswell/gma.c b/src/northbridge/intel/haswell/gma.c
index f22ff48707..75f3b7a944 100644
--- a/src/northbridge/intel/haswell/gma.c
+++ b/src/northbridge/intel/haswell/gma.c
@@ -252,13 +252,13 @@ static void gma_pm_init_pre_vbios(struct device *dev)
gtt_write_regs(haswell_gt_setup);
/* Wait for Mailbox Ready */
- gtt_poll(0x138124, (1 << 31), (0 << 31));
+ gtt_poll(0x138124, (1UL << 31), (0UL << 31));
/* Mailbox Data - RC6 VIDS */
gtt_write(0x138128, 0x00000000);
/* Mailbox Command */
gtt_write(0x138124, 0x80000004);
/* Wait for Mailbox Ready */
- gtt_poll(0x138124, (1 << 31), (0 << 31));
+ gtt_poll(0x138124, (1UL << 31), (0UL << 31));
/* Enable PM Interrupts */
gtt_write(GEN6_PMIER, GEN6_PM_MBOX_EVENT | GEN6_PM_THERMAL_EVENT |