Skip to content

Commit 72080fe

Browse files
asahilinaojeda
authored andcommitted
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 <[email protected]> Reviewed-by: Martin Rodriguez Reboredo <[email protected]> Signed-off-by: Asahi Lina <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Miguel Ojeda <[email protected]>
1 parent c4284a7 commit 72080fe

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

rust/kernel/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub struct Error(core::ffi::c_int);
7373

7474
impl Error {
7575
/// Returns the kernel error code.
76-
pub fn to_kernel_errno(self) -> core::ffi::c_int {
76+
pub fn to_errno(self) -> core::ffi::c_int {
7777
self.0
7878
}
7979
}

rust/macros/module.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream {
278278
return 0;
279279
}}
280280
Err(e) => {{
281-
return e.to_kernel_errno();
281+
return e.to_errno();
282282
}}
283283
}}
284284
}}

0 commit comments

Comments
 (0)