diff options
| author | Yury Norov <ynorov@nvidia.com> | 2026-07-08 22:03:11 -0400 |
|---|---|---|
| committer | Yury Norov <ynorov@nvidia.com> | 2026-07-22 15:38:38 -0400 |
| commit | bf7e3686b708683efe6b7ee79ae4c83a875dbc6f (patch) | |
| tree | 3109fa4d1b1175d76a4846c6fa3295917f8eff98 /include/linux | |
| parent | e46185c13953500ed868751b944a96974eaca923 (diff) | |
bitmap: Return size when no zero area is found
Return the bitmap size, rather than size + 1, when
bitmap_find_next_zero_area_off() cannot find a suitable area. This
matches the conventional find_bit() failure sentinel and still lets
callers detect failure with an out-of-range check.
Document the public failure contract as a value greater than or equal
to the bitmap size, without requiring callers to depend on the exact
sentinel.
Signed-off-by: Yury Norov <ynorov@nvidia.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/bitmap.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index a967e1f7542b..7df1573a409c 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h @@ -209,6 +209,9 @@ unsigned long bitmap_find_next_zero_area_off(unsigned long *map, * The @align_mask should be one less than a power of 2; the effect is that * the bit offset of all zero areas this function finds is multiples of that * power of 2. A @align_mask of 0 means no alignment is required. + * + * Return: The bit offset of the found area or a value >= @size + * if no area is found. */ static __always_inline unsigned long bitmap_find_next_zero_area(unsigned long *map, |
