From: Xiang W Date: Tue, 25 Apr 2023 11:32:21 +0000 (+0800) Subject: lib: sbi: Simplify BITS_PER_LONG definition X-Git-Tag: v1.3~39 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dc1c7db05e075e0910b93504370b50d064a51402;p=platform%2Fkernel%2Fopensbi.git lib: sbi: Simplify BITS_PER_LONG definition No need to use #elif ladder when defining BITS_PER_LONG. Signed-off-by: Xiang W Reviewed-by: Andrew Jones Reviewed-by: Anup Patel --- diff --git a/include/sbi/sbi_bitops.h b/include/sbi/sbi_bitops.h index 251e4d8..2e08947 100644 --- a/include/sbi/sbi_bitops.h +++ b/include/sbi/sbi_bitops.h @@ -12,13 +12,7 @@ #include -#if __SIZEOF_POINTER__ == 8 -#define BITS_PER_LONG 64 -#elif __SIZEOF_POINTER__ == 4 -#define BITS_PER_LONG 32 -#else -#error "Unexpected __SIZEOF_POINTER__" -#endif +#define BITS_PER_LONG (8 * __SIZEOF_LONG__) #define EXTRACT_FIELD(val, which) \ (((val) & (which)) / ((which) & ~((which)-1)))