Skip to content

Commit

Permalink
rust: error: Rename to_kernel_errno() -> to_errno()
Browse files Browse the repository at this point in the history
This is kernel code, so specifying "kernel" is redundant. Let's simplify
things and just call it to_errno().

Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
Link: https://lore.kernel.org/r/20230224-rust-error-v3-1-03779bddc02b@asahilina.net
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
  • Loading branch information
Asahi Lina authored and Miguel Ojeda committed Apr 12, 2023
1 parent 31d95c2 commit 46384d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rust/kernel/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub struct Error(core::ffi::c_int);

impl Error {
/// Returns the kernel error code.
pub fn to_kernel_errno(self) -> core::ffi::c_int {
pub fn to_errno(self) -> core::ffi::c_int {
self.0
}
}
Expand Down
2 changes: 1 addition & 1 deletion rust/macros/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream {
return 0;
}}
Err(e) => {{
return e.to_kernel_errno();
return e.to_errno();
}}
}}
}}
Expand Down

0 comments on commit 46384d0

Please sign in to comment.