nb/intel/haswell/pcie.c: Make UBSAN not complain
commit08391d2f5ffea38aa95152c53492f72261786714
authorAngel Pons <th3fanbus@gmail.com>
Tue, 7 Feb 2023 14:03:07 +0000 (7 15:03 +0100)
committerFelix Held <felix-coreboot@felixheld.de>
Tue, 21 Mar 2023 23:34:02 +0000 (21 23:34 +0000)
tree2bfc9ea57a224eb612bc52651fdb66cc1fe51e12
parent6b7b4001930afa9f09273809df7501277f47e793
nb/intel/haswell/pcie.c: Make UBSAN not complain

UBSAN complains about "shift out of bounds", likely because integer
literals are signed by default and the result of the operation will
shift into the sign bit, yielding a negative value. However, as the
negative value is then casted to an unsigned type, it works anyway.
To make UBSAN happy, make sure the two troublesome integer literals
are unsigned so that there's no sign bit to shift into.

Tested on out-of-tree Asrock Z97 Extreme6, UBSAN now dies elsewhere.

Link: https://ticket.coreboot.org/issues/449
Change-Id: Iaf8710a5ae4e05d9f41f40f9e3617e155027800c
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72806
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
src/northbridge/intel/haswell/pcie.c