diff options
| author | Yury Norov <ynorov@nvidia.com> | 2026-03-19 03:43:48 +0300 |
|---|---|---|
| committer | Yury Norov <ynorov@nvidia.com> | 2026-03-24 20:39:53 +0300 |
| commit | 95d324fb1b48434f4c659e4c245c3bdeecdff22c (patch) | |
| tree | 475263fc074b42a66c866466e637c23894c7d090 /lib/bitmap.c | |
| parent | 2a4d3706d864d19ba8772b7a5e74328ac5c1007d (diff) | |
| download | linux-95d324fb1b48434f4c659e4c245c3bdeecdff22c.tar.xz | |
bitmap: add test_zero_nbits()
In most real-life cases, 0-length bitmap provided by user is a sign of
an error. The API doesn't provide any guarantees on returned value, and
the bitmap pointers are not dereferenced.
Signed-off-by: Yury Norov <ynorov@nvidia.com>
Diffstat (limited to 'lib/bitmap.c')
| -rw-r--r-- | lib/bitmap.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/bitmap.c b/lib/bitmap.c index 9dc526507875..1b897f94e0ff 100644 --- a/lib/bitmap.c +++ b/lib/bitmap.c @@ -69,6 +69,7 @@ bool __bitmap_or_equal(const unsigned long *bitmap1, tmp = (bitmap1[k] | bitmap2[k]) ^ bitmap3[k]; return (tmp & BITMAP_LAST_WORD_MASK(bits)) == 0; } +EXPORT_SYMBOL(__bitmap_or_equal); void __bitmap_complement(unsigned long *dst, const unsigned long *src, unsigned int bits) { @@ -360,6 +361,7 @@ unsigned int __bitmap_weighted_or(unsigned long *dst, const unsigned long *bitma { return BITMAP_WEIGHT(({dst[idx] = bitmap1[idx] | bitmap2[idx]; dst[idx]; }), bits); } +EXPORT_SYMBOL(__bitmap_weighted_or); void __bitmap_set(unsigned long *map, unsigned int start, int len) { |
