summaryrefslogtreecommitdiff
path: root/rust/kernel/alloc/kvec/errors.rs
diff options
context:
space:
mode:
authorMirko Adzic <adzicmirko97@gmail.com>2026-03-29 12:41:10 +0200
committerMiguel Ojeda <ojeda@kernel.org>2026-04-03 11:56:56 +0200
commit7ccef29b5d93d6e235dc8ace27cfbbfbbede9908 (patch)
tree90c14b1898088e0ebea07d89ac5dfd2355d443d9 /rust/kernel/alloc/kvec/errors.rs
parent3418d862679ac6da0b6bd681b18b3189c4fad20d (diff)
rust: error: clarify that `from_err_ptr` can return `Ok(NULL)`
Improve the doc comment of `from_err_ptr` by explicitly stating that it will return `Ok(NULL)` when passed a null pointer, as it isn't an error value. Add a doctest case that tests the behavior described above, as well as other scenarios (non-null/non-error pointer, error value). Suggested-by: Miguel Ojeda <ojeda@kernel.org> Link: https://lore.kernel.org/rust-for-linux/20260322193830.89324-1-ojeda@kernel.org/ Link: https://github.com/Rust-for-Linux/linux/issues/1231 Signed-off-by: Mirko Adzic <adzicmirko97@gmail.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://patch.msgid.link/20260329104319.131057-1-adzicmirko97@gmail.com [ - Added `expect` for `clippy::missing_safety_doc`. - Simplified and removed unsafe block using `Error::to_ptr()`. - Added intra-doc link. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/kernel/alloc/kvec/errors.rs')
0 files changed, 0 insertions, 0 deletions