Files
linux/rust/kernel
Mirko Adzic 7ccef29b5d 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 <[email protected]>
Link: https://lore.kernel.org/rust-for-linux/[email protected]/
Link: https://github.com/Rust-for-Linux/linux/issues/1231
Signed-off-by: Mirko Adzic <[email protected]>
Reviewed-by: Alice Ryhl <[email protected]>
Link: https://patch.msgid.link/[email protected]
[ - 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 <[email protected]>
2026-04-03 11:56:56 +02:00
..
2025-11-05 00:05:38 +01:00
2025-11-29 10:41:09 -08:00
2026-03-30 02:03:49 +02:00
2025-11-04 13:25:29 +01:00
2025-07-23 02:05:58 +02:00
2025-09-06 13:27:20 +02:00
…
…
2026-02-01 22:18:24 +01:00
2026-03-30 02:03:49 +02:00
2026-01-30 05:47:05 +01:00
2025-08-21 16:58:07 +02:00
2026-03-30 02:03:49 +02:00
2025-12-28 12:43:56 +01:00