diff --git a/Makefile b/Makefile index 836643eaefee0e..2db515eb8ff6f6 100644 --- a/Makefile +++ b/Makefile @@ -466,6 +466,7 @@ export rust_common_flags := --edition=2021 \ -Dclippy::let_unit_value -Dclippy::mut_mut \ -Dclippy::needless_bitwise_bool \ -Dclippy::needless_continue \ + -Dclippy::no_mangle_with_rust_abi \ -Wclippy::dbg_macro KBUILD_HOSTCFLAGS := $(KBUILD_USERHOSTCFLAGS) $(HOST_LFS_CFLAGS) $(HOSTCFLAGS) diff --git a/rust/kernel/allocator.rs b/rust/kernel/allocator.rs index 397a3dd57a9b13..280676993074c1 100644 --- a/rust/kernel/allocator.rs +++ b/rust/kernel/allocator.rs @@ -31,16 +31,19 @@ static ALLOCATOR: KernelAllocator = KernelAllocator; // let's generate them ourselves instead. // // Note that `#[no_mangle]` implies exported too, nowadays. +#[allow(clippy::no_mangle_with_rust_abi)] #[no_mangle] fn __rust_alloc(size: usize, _align: usize) -> *mut u8 { unsafe { bindings::krealloc(core::ptr::null(), size, bindings::GFP_KERNEL) as *mut u8 } } +#[allow(clippy::no_mangle_with_rust_abi)] #[no_mangle] fn __rust_dealloc(ptr: *mut u8, _size: usize, _align: usize) { unsafe { bindings::kfree(ptr as *const core::ffi::c_void) }; } +#[allow(clippy::no_mangle_with_rust_abi)] #[no_mangle] fn __rust_realloc(ptr: *mut u8, _old_size: usize, _align: usize, new_size: usize) -> *mut u8 { unsafe { @@ -52,6 +55,7 @@ fn __rust_realloc(ptr: *mut u8, _old_size: usize, _align: usize, new_size: usize } } +#[allow(clippy::no_mangle_with_rust_abi)] #[no_mangle] fn __rust_alloc_zeroed(size: usize, _align: usize) -> *mut u8 { unsafe {