From 76be5ff6f0dfc15dd8baa3c9fb8b1d88e948aba9 Mon Sep 17 00:00:00 2001 From: Mateusz Kozlowski Date: Fri, 11 Oct 2019 12:59:47 +0200 Subject: [PATCH] util: Promote shifted value in spdk_align64pow2 to uint64 Fix asan/valgrind error when using spdk_align64pow2 with >=32b values. Signed-off-by: Mateusz Kozlowski Change-Id: I326a32a01a5b8b5ee9b10693900a60c50ee8f900 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471058 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Tomasz Zawadzki Reviewed-by: Shuhei Matsumoto Reviewed-by: Jim Harris Reviewed-by: Wojciech Malikowski Reviewed-by: Konrad Sztyber --- include/spdk/util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/spdk/util.h b/include/spdk/util.h index defa86865..4e8e553b5 100644 --- a/include/spdk/util.h +++ b/include/spdk/util.h @@ -70,7 +70,7 @@ uint64_t spdk_u64log2(uint64_t x); static inline uint64_t spdk_align64pow2(uint64_t x) { - return 1u << (1 + spdk_u64log2(x - 1)); + return 1ULL << (1 + spdk_u64log2(x - 1)); } /**