mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-25 07:41:42 +01:00
lib: fix compilation when strings.h is included
In a systems that provide strings.h and it is included together with sbi_bitops.h the compilation error appears. The ffs() and fls() are provided by strings.h Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:

committed by
Anup Patel

parent
5d53b55aa7
commit
6ad8917b7e
@@ -154,7 +154,7 @@ static int aclint_mtimer_add_regions(unsigned long addr, unsigned long size)
|
||||
while (pos < end) {
|
||||
rsize = pos & (MTIMER_ADD_REGION_ALIGN - 1);
|
||||
if (rsize)
|
||||
rsize = 1UL << __ffs(pos);
|
||||
rsize = 1UL << sbi_ffs(pos);
|
||||
else
|
||||
rsize = ((end - pos) < MTIMER_ADD_REGION_ALIGN) ?
|
||||
(end - pos) : MTIMER_ADD_REGION_ALIGN;
|
||||
|
Reference in New Issue
Block a user