From 424c5d3ac17a3efc4b678961e6b3036c8fb25ea8 Mon Sep 17 00:00:00 2001 From: Li Hongyu <543306408@qq.com> Date: Tue, 27 Sep 2022 14:36:55 +0000 Subject: [PATCH] rust: fix the compile bug openEuler inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I5THDX CVE: NA -------------------------------- The current kernel with CONFIG_RUST can not compile. Signed-off-by: Li Hongyu <543306408@qq.com> --- rust/kernel/amba.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rust/kernel/amba.rs b/rust/kernel/amba.rs index 61eedcd21ca4..12ffbfe24faa 100644 --- a/rust/kernel/amba.rs +++ b/rust/kernel/amba.rs @@ -133,7 +133,7 @@ unsafe extern "C" fn probe_callback( } } -unsafe extern "C" fn remove_callback(adev: *mut bindings::amba_device) -> i32 { +unsafe extern "C" fn remove_callback(adev: *mut bindings::amba_device) { // SAFETY: `adev` is valid by the contract with the C code. let ptr = unsafe { bindings::amba_get_drvdata(adev) }; // SAFETY: The value returned by `amba_get_drvdata` was stored by a previous call to @@ -142,7 +142,6 @@ unsafe extern "C" fn remove_callback(adev: *mut bindings::amba_device let data = unsafe { T::Data::from_pointer(ptr) }; T::remove(&data); ::device_remove(&data); - 0 } /// An Amba device. -- GitLab