summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorYury Norov <yury.norov@gmail.com>2022-09-18 06:07:15 +0300
committerYury Norov <yury.norov@gmail.com>2022-09-26 22:19:12 +0300
commit97848c10f9f8a8ce4296b149d06cab424eba05b3 (patch)
tree963487077ade5afd1c1cea2372aa1bb68084127d /include/linux
parente3783c805db29c8cb3e8dcc8160f6449da1100e3 (diff)
downloadlinux-97848c10f9f8a8ce4296b149d06cab424eba05b3.tar.xz
lib/bitmap: remove bitmap_ord_to_pos
Now that we have find_nth_bit(), we can drop bitmap_ord_to_pos(). Signed-off-by: Yury Norov <yury.norov@gmail.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/bitmap.h1
-rw-r--r--include/linux/nodemask.h3
2 files changed, 1 insertions, 3 deletions
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
index b2aef45af0db..7d6d73b78147 100644
--- a/include/linux/bitmap.h
+++ b/include/linux/bitmap.h
@@ -225,7 +225,6 @@ void bitmap_copy_le(unsigned long *dst, const unsigned long *src, unsigned int n
#else
#define bitmap_copy_le bitmap_copy
#endif
-unsigned int bitmap_ord_to_pos(const unsigned long *bitmap, unsigned int ord, unsigned int nbits);
int bitmap_print_to_pagebuf(bool list, char *buf,
const unsigned long *maskp, int nmaskbits);
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index 4b71a96190a8..0c45fb066caa 100644
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@ -508,8 +508,7 @@ static inline int node_random(const nodemask_t *maskp)
w = nodes_weight(*maskp);
if (w)
- bit = bitmap_ord_to_pos(maskp->bits,
- get_random_int() % w, MAX_NUMNODES);
+ bit = find_nth_bit(maskp->bits, MAX_NUMNODES, get_random_int() % w);
return bit;
#else
return 0;