From 6df355da879797899eb6337eb21868163c1ee07d Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Thu, 9 Jul 2015 15:47:07 -0700 Subject: [PATCH] libpayload: Fix arithmetic precedence in div_round_up() Well, this is just embarrassing... BRANCH=None BUG=None TEST=None Change-Id: I7c443d2100b6861d736320ac14c1bd9965937a66 Signed-off-by: Patrick Georgi Original-Commit-Id: 455e3784882ea1b76bcf8e17724869e37d9c629d Original-Change-Id: Ia33e98aeaa8e78e3e3d2c7547e673a623ea86ce2 Original-Signed-off-by: Julius Werner Original-Reviewed-on: https://chromium-review.googlesource.com/284596 Original-Reviewed-by: Duncan Laurie Reviewed-on: http://review.coreboot.org/10879 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi Reviewed-by: Martin Roth --- payloads/libpayload/include/libpayload.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h index c09fc172ef..8f17b58fcb 100644 --- a/payloads/libpayload/include/libpayload.h +++ b/payloads/libpayload/include/libpayload.h @@ -64,7 +64,7 @@ #define MAX(a,b) ((a) > (b) ? (a) : (b)) #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) -static inline u32 div_round_up(u32 n, u32 d) { return n + d - 1 / d; } +static inline u32 div_round_up(u32 n, u32 d) { return (n + d - 1) / d; } #define LITTLE_ENDIAN 1234 #define BIG_ENDIAN 4321