Skip to contentSkip to conversation

rust: bitmap: fix intra-doc link

PATCH Applied Miguel Ojeda 3 participants 3 messages Nov 6

Subsystems (2)
lore
Share & tools
lore

Miguel Ojeda

author maintainer
#0 lore raw

PATCH 1/1 rust: bitmap: fix intra-doc link

BitmapVec::MAX_LEN does not exist in 6.18.y, so rustdoc warns:

    warning: unresolved link to `BitmapVec::MAX_LEN`
      --> rust/kernel/bitmap.rs:24:25
       |
    24 | /// This also matches [`BitmapVec::MAX_LEN`].
       |                         ^^^^^^^^^^^^^^^^^^ the struct `BitmapVec` has no field or associated item named `MAX_LEN`
       |
       = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default

Thus link to BitmapVec::new() instead.

Fixes 37f45fe068e0 ("rust: bitmap: restrict bitmap length to at most i32::MAX")

---
Another option (cleaner but a bigger change) is to cherry-pick:

f5535d78e126 ("rust: bitmap: add MAX_LEN and MAX_INLINE_LEN constants")

 rust/kernel/bitmap.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
rust/kernel/bitmap.rs +1 -1
index c2634561b023..badc3eb5282b 100644
@@ -21,7 +21,7 @@
 /// Must reference a `[c_ulong]` long enough to fit `data.len()` bits.
 /// Must not be longer than [`i32::MAX`] bits, so offsets and lengths used with
 /// [`Bitmap`] functions fit in the `int` and `unsigned int` arguments of the C bitmap API.
-/// This also matches [`BitmapVec::MAX_LEN`].
+/// This also matches the maximum length accepted by [`BitmapVec::new`].
 #[cfg_attr(CONFIG_64BIT, repr(align(8)))]
 #[cfg_attr(not(CONFIG_64BIT), repr(align(4)))]
 pub struct Bitmap {

base-commit: a7c80de5ffd00886e3e6b7469611536b0d481cda --
2.56.0

reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Miguel Ojeda

BitmapVec::MAX_LEN does not exist in 6.18.y, so rustdoc warns:

    warning: unresolved link to `BitmapVec::MAX_LEN`
      --> rust/kernel/bitmap.rs:24:25
       |
    24 | /// This also matches [`BitmapVec::MAX_LEN`].
       |                         ^^^^^^^^^^^^^^^^^^ the struct `BitmapVec` has no field or associated item named `MAX_LEN`
       |
       = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
Quoted 8 lines

Thus link to BitmapVec::new() instead.

Fixes 37f45fe068e0 ("rust: bitmap: restrict bitmap length to at most i32::MAX")

---
Another option (cleaner but a bigger change) is to cherry-pick:

f5535d78e126 ("rust: bitmap: add MAX_LEN and MAX_INLINE_LEN constants")

Both options (this one-liner fix or cherry-picking f5535d78e126) look good to me.

Alice

maintainer Applied
#2 lore raw
In reply to Miguel Ojeda
Quoted 1 line

BitmapVec::MAX_LEN does not exist in 6.18.y, so rustdoc warns:

Queued for 6.18, thanks.

Signature · 2 lines
Thanks,
Sasha