mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
rust: error: Rename to_kernel_errno() -> to_errno()
commit 46384d0990 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b548c53bc3
commit
8762bf944a
@@ -25,7 +25,7 @@ pub struct Error(core::ffi::c_int);
|
|||||||
|
|
||||||
impl Error {
|
impl Error {
|
||||||
/// Returns the kernel error code.
|
/// 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
|
self.0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -258,7 +258,7 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream {
|
|||||||
return 0;
|
return 0;
|
||||||
}}
|
}}
|
||||||
Err(e) => {{
|
Err(e) => {{
|
||||||
return e.to_kernel_errno();
|
return e.to_errno();
|
||||||
}}
|
}}
|
||||||
}}
|
}}
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user