Re: [PATCH v2] rust: bitmap: document panics in `next_bit` and `next_zero_bit`

From: George Androutsopoulos

Date: Tue Sep 01 2026 - 11:35:27 EST


On Tue, Sep 1, 2026 at 5:48 AM Miguel Ojeda
<miguel.ojeda.sandonis@xxxxxxxxx> wrote:
> Maybe -- it depends on whether we consider this kind of documentation
> hole a bug or not. But if we do, then we want a Fixes: too.

I lean towards treating that as a bug and sending a v3 with `Closes:`
and `Fixes:`.

These are public `kernel` crate functions intended for driver authors,
and nothing in their documentation indicated they could panic. Finding
that out required reading the body and following it into
`bitmap_assert!`. For `next_bit()` and `next_zero_bit()` the docs went
further and stated that `None` is returned for exactly the input that
panics when `CONFIG_RUST_BITMAP_HARDENED` is enabled.

The same question applies to the `id_pool` patch ("rust: id_pool:
document panics in `find_unused_id` and `release_id`"), where the
docs were silent rather than contradictory.

Thanks,
Georgios