diff options
author | Wedson Almeida Filho <[email protected]> | 2023-04-03 18:48:13 +0900 |
---|---|---|
committer | Miguel Ojeda <[email protected]> | 2023-04-12 18:41:04 +0200 |
commit | 086fbfa3b328901fa8b369093ba468864e20544e (patch) | |
tree | d0dffc6df92019dd32b6ffb5eca65306241a32e1 /scripts/gdb/linux/proc.py | |
parent | 6551a7fe0acbbc816802350414b37d9b42daccc8 (diff) |
rust: error: Add to_result() helper
Add a to_result() helper to convert kernel C return values to a Rust
Result, mapping >=0 values to Ok(()) and negative values to Err(...),
with Error::from_errno() ensuring that the errno is within range.
Lina: Imported from rust-for-linux/rust, originally developed by Wedson
as part of the AMBA device driver support.
Signed-off-by: Wedson Almeida Filho <[email protected]>
Reviewed-by: Andreas Hindborg <[email protected]>
Reviewed-by: Gary Guo <[email protected]>
Reviewed-by: Martin Rodriguez Reboredo <[email protected]>
Signed-off-by: Asahi Lina <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Add a removal of `#[allow(dead_code)]`. ]
Signed-off-by: Miguel Ojeda <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/proc.py')
0 files changed, 0 insertions, 0 deletions