aboutsummaryrefslogtreecommitdiff
path: root/src/southbridge/intel/lynxpoint/sata.c
diff options
context:
space:
mode:
authorRyan Salsamendi <rsalsamendi@hotmail.com>2017-07-04 13:14:16 -0700
committerMartin Roth <martinroth@google.com>2017-07-10 18:15:11 +0000
commit3f2fe18965fc5404e4d095a25dcb1be48e4040a5 (patch)
treef17cc962dad56d84ff9eb481564406e8fcced61d /src/southbridge/intel/lynxpoint/sata.c
parent2fdf895867bc258690943475f0d2e8fc7daa6ee5 (diff)
southbridge/intel/lynxpoint: Fix undefined behavior
Fix undefined behavior found by clang's -Wshift-sign-overflow, grep, and source inspection. 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: I10db2566199200ceb3068721cfb35eadb2be1f68 Signed-off-by: Ryan Salsamendi <rsalsamendi@hotmail.com> Reviewed-on: https://review.coreboot.org/20464 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'src/southbridge/intel/lynxpoint/sata.c')
-rw-r--r--src/southbridge/intel/lynxpoint/sata.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/southbridge/intel/lynxpoint/sata.c b/src/southbridge/intel/lynxpoint/sata.c
index 31081d7810..c45579b045 100644
--- a/src/southbridge/intel/lynxpoint/sata.c
+++ b/src/southbridge/intel/lynxpoint/sata.c
@@ -134,7 +134,7 @@ static void sata_init(struct device *dev)
reg32 |= 1 << 18; /* BWG step 10 */
reg32 |= 1 << 29; /* BWG step 11 */
if (pch_is_lp()) {
- reg32 &= ~((1 << 31) | (1 << 30));
+ reg32 &= ~((1UL << 31) | (1 << 30));
reg32 |= 1 << 23;
reg32 |= 1 << 24; /* Disable listen mode (hotplug) */
}