mirror of
https://github.com/Fishwaldo/opensbi.git
synced 2025-06-27 08:38:36 +00:00
lib: sbi: Simplify BITS_PER_LONG definition
No need to use #elif ladder when defining BITS_PER_LONG. Signed-off-by: Xiang W <wxjstz@126.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
parent
6bc02dede8
commit
dc1c7db05e
1 changed files with 1 additions and 7 deletions
|
@ -12,13 +12,7 @@
|
||||||
|
|
||||||
#include <sbi/sbi_types.h>
|
#include <sbi/sbi_types.h>
|
||||||
|
|
||||||
#if __SIZEOF_POINTER__ == 8
|
#define BITS_PER_LONG (8 * __SIZEOF_LONG__)
|
||||||
#define BITS_PER_LONG 64
|
|
||||||
#elif __SIZEOF_POINTER__ == 4
|
|
||||||
#define BITS_PER_LONG 32
|
|
||||||
#else
|
|
||||||
#error "Unexpected __SIZEOF_POINTER__"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define EXTRACT_FIELD(val, which) \
|
#define EXTRACT_FIELD(val, which) \
|
||||||
(((val) & (which)) / ((which) & ~((which)-1)))
|
(((val) & (which)) / ((which) & ~((which)-1)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue