summaryrefslogtreecommitdiff
path: root/rust
diff options
context:
space:
mode:
authorAsahi Lina <lina@asahilina.net>2023-04-03 12:48:10 +0300
committerMiguel Ojeda <ojeda@kernel.org>2023-04-12 19:41:04 +0300
commit46384d0990bf99ed8b597e8794ea581e2a647710 (patch)
tree2a522f2c675d53718ab0446833ab8f9054ff83b2 /rust
parent31d95c2f99bf16e59b996cf6a227e198a64e835c (diff)
downloadlinux-46384d0990bf99ed8b597e8794ea581e2a647710.tar.xz
rust: error: Rename to_kernel_errno() -> to_errno()
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>
Diffstat (limited to 'rust')
-rw-r--r--rust/kernel/error.rs2
-rw-r--r--rust/macros/module.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/rust/kernel/error.rs b/rust/kernel/error.rs
index 5b9751d7ff1d..35894fa35efe 100644
--- a/rust/kernel/error.rs
+++ b/rust/kernel/error.rs
@@ -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
}
}
diff --git a/rust/macros/module.rs b/rust/macros/module.rs
index 5e7ab83908a0..fb1244f8c2e6 100644
--- a/rust/macros/module.rs
+++ b/rust/macros/module.rs
@@ -278,7 +278,7 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream {
return 0;
}}
Err(e) => {{
- return e.to_kernel_errno();
+ return e.to_errno();
}}
}}
}}