summaryrefslogtreecommitdiff
path: root/lib/sbi/sbi_bitops.c
diff options
context:
space:
mode:
authorPetro Karashchenko <petro.karashchenko@gmail.com>2022-01-28 10:13:23 +0300
committerAnup Patel <anup@brainfault.org>2022-02-04 08:34:19 +0300
commit6ad8917b7e27e5e80fb9268492b9111b17ed2024 (patch)
treed8af3fafb149bdcc42b7d8905940b846b135fdfc /lib/sbi/sbi_bitops.c
parent5d53b55aa77ffeefd4012445dfa6ad3535e1ff2c (diff)
downloadopensbi-6ad8917b7e27e5e80fb9268492b9111b17ed2024.tar.xz
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>
Diffstat (limited to 'lib/sbi/sbi_bitops.c')
-rw-r--r--lib/sbi/sbi_bitops.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/sbi/sbi_bitops.c b/lib/sbi/sbi_bitops.c
index de9d045..becea91 100644
--- a/lib/sbi/sbi_bitops.c
+++ b/lib/sbi/sbi_bitops.c
@@ -39,7 +39,7 @@ unsigned long find_first_bit(const unsigned long *addr,
if (tmp == 0UL) /* Are any bits set? */
return result + size; /* Nope. */
found:
- return result + __ffs(tmp);
+ return result + sbi_ffs(tmp);
}
/**
@@ -69,7 +69,7 @@ unsigned long find_first_zero_bit(const unsigned long *addr,
if (tmp == ~0UL) /* Are any bits zero? */
return result + size; /* Nope. */
found:
- return result + ffz(tmp);
+ return result + sbi_ffz(tmp);
}
/**
@@ -100,7 +100,7 @@ unsigned long find_last_bit(const unsigned long *addr,
tmp = addr[--words];
if (tmp) {
found:
- return words * BITS_PER_LONG + __fls(tmp);
+ return words * BITS_PER_LONG + sbi_fls(tmp);
}
}
@@ -150,7 +150,7 @@ found_first:
if (tmp == 0UL) /* Are any bits set? */
return result + size; /* Nope. */
found_middle:
- return result + __ffs(tmp);
+ return result + sbi_ffs(tmp);
}
/**
@@ -196,5 +196,5 @@ found_first:
if (tmp == ~0UL) /* Are any bits zero? */
return result + size; /* Nope. */
found_middle:
- return result + ffz(tmp);
+ return result + sbi_ffz(tmp);
}