From c66543d049d33b94f1915babaed6eb1f90e05f78 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Mon, 17 Feb 2020 20:55:12 -0800 Subject: lib: utils: htif: Fix 32-bit build When building 32-bit OpenSBI images, we get: lib/utils/sys/htif.c: In function '__check_fromhost': lib/utils/sys/htif.c:12:31: error: left shift count >= width of type [-Werror=shift-count-overflow] #define HTIF_DATA_MASK ((1UL << HTIF_DATA_BITS) - 1) ^~ Fixes: c2f23cc6edd7 ("platform: Add Spike initial support") Signed-off-by: Bin Meng Reviewed-by: Anup Patel --- lib/utils/sys/htif.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/utils/sys/htif.c') diff --git a/lib/utils/sys/htif.c b/lib/utils/sys/htif.c index f0ba814..e82590f 100644 --- a/lib/utils/sys/htif.c +++ b/lib/utils/sys/htif.c @@ -9,13 +9,13 @@ #include #define HTIF_DATA_BITS 48 -#define HTIF_DATA_MASK ((1UL << HTIF_DATA_BITS) - 1) +#define HTIF_DATA_MASK ((1ULL << HTIF_DATA_BITS) - 1) #define HTIF_DATA_SHIFT 0 #define HTIF_CMD_BITS 8 -#define HTIF_CMD_MASK ((1UL << HTIF_CMD_BITS) - 1) +#define HTIF_CMD_MASK ((1ULL << HTIF_CMD_BITS) - 1) #define HTIF_CMD_SHIFT 48 #define HTIF_DEV_BITS 8 -#define HTIF_DEV_MASK ((1UL << HTIF_DEV_BITS) - 1) +#define HTIF_DEV_MASK ((1ULL << HTIF_DEV_BITS) - 1) #define HTIF_DEV_SHIFT 56 #define HTIF_DEV_SYSTEM 0 -- cgit v1.2.3