summaryrefslogtreecommitdiff
path: root/tools/testing/radix-tree/bitmap.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2024-08-01 10:43:15 -0700
committerJakub Kicinski <kuba@kernel.org>2024-08-01 10:45:23 -0700
commit5fa35bd39ce106889909444c937a10b2d3a79f08 (patch)
treebb1fde34b2c9907b1c4b69f6db992bbda0b02355 /tools/testing/radix-tree/bitmap.c
parent743ff02152bc46bb4a2f2a49ec891c87eba6ab5b (diff)
parent183d46ff422ef9f3d755b6808ef3faa6d009ba3a (diff)
downloadlwn-5fa35bd39ce106889909444c937a10b2d3a79f08.tar.gz
lwn-5fa35bd39ce106889909444c937a10b2d3a79f08.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Cross-merge networking fixes after downstream PR. No conflicts or adjacent changes. Link: https://patch.msgid.link/20240801131917.34494-1-pabeni@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing/radix-tree/bitmap.c')
-rw-r--r--tools/testing/radix-tree/bitmap.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/tools/testing/radix-tree/bitmap.c b/tools/testing/radix-tree/bitmap.c
deleted file mode 100644
index 66ec4a24a203..000000000000
--- a/tools/testing/radix-tree/bitmap.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* lib/bitmap.c pulls in at least two other files. */
-
-#include <linux/bitmap.h>
-
-void bitmap_clear(unsigned long *map, unsigned int start, int len)
-{
- unsigned long *p = map + BIT_WORD(start);
- const unsigned int size = start + len;
- int bits_to_clear = BITS_PER_LONG - (start % BITS_PER_LONG);
- unsigned long mask_to_clear = BITMAP_FIRST_WORD_MASK(start);
-
- while (len - bits_to_clear >= 0) {
- *p &= ~mask_to_clear;
- len -= bits_to_clear;
- bits_to_clear = BITS_PER_LONG;
- mask_to_clear = ~0UL;
- p++;
- }
- if (len) {
- mask_to_clear &= BITMAP_LAST_WORD_MASK(size);
- *p &= ~mask_to_clear;
- }
-}