diff options
author | Asahi Lina <lina@asahilina.net> | 2023-04-03 12:48:10 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-05-17 12:56:16 +0300 |
commit | 8762bf944a4b5b42e7fae3825988df12150cd467 (patch) | |
tree | 49ca18f2eab4b456e02b1075748ea3682cc04c7c /rust | |
parent | b548c53bc3ab83dc6fc86c8e840f013b2032267a (diff) | |
download | linux-8762bf944a4b5b42e7fae3825988df12150cd467.tar.xz |
rust: error: Rename to_kernel_errno() -> to_errno()
commit 46384d0990bf99ed8b597e8794ea581e2a647710 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'rust')
-rw-r--r-- | rust/kernel/error.rs | 2 | ||||
-rw-r--r-- | rust/macros/module.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/rust/kernel/error.rs b/rust/kernel/error.rs index 466b2a8fe569..4a3a6306cfe1 100644 --- a/rust/kernel/error.rs +++ b/rust/kernel/error.rs @@ -25,7 +25,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 } } diff --git a/rust/macros/module.rs b/rust/macros/module.rs index 186a5b8be23c..49f7ce31c4cf 100644 --- a/rust/macros/module.rs +++ b/rust/macros/module.rs @@ -258,7 +258,7 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream { return 0; }} Err(e) => {{ - return e.to_kernel_errno(); + return e.to_errno(); }} }} }} |