Skip to content

Commit bd47ed7

Browse files
committed
rust: kernel: Removed function name in FFI call.
body: No need to mention the function being called in FFI.
1 parent 2c60d00 commit bd47ed7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

rust/kernel/allocator.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ unsafe impl GlobalAlloc for KernelAllocator {
1414
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
1515
// `krealloc()` is used instead of `kmalloc()` because the latter is
1616
// an inline function and cannot be bound to as a result.
17-
// SAFETY: FFI call to krealloc.
17+
// SAFETY: FFI call.
1818
unsafe { bindings::krealloc(ptr::null(), layout.size(), bindings::GFP_KERNEL) as *mut u8 }
1919
}
2020

2121
unsafe fn dealloc(&self, ptr: *mut u8, _layout: Layout) {
2222
// SAFETY: the caller must guarantee that `ptr` and `layout` denote memory
2323
// allocated by this allocator, so allocated with `kmalloc`.
24-
// FFI call to kfree
24+
// FFI call.
2525
unsafe {
2626
bindings::kfree(ptr as *const c_types::c_void);
2727
}
@@ -36,21 +36,21 @@ static ALLOCATOR: KernelAllocator = KernelAllocator;
3636
// let's generate them ourselves instead.
3737
#[no_mangle]
3838
pub fn __rust_alloc(size: usize, _align: usize) -> *mut u8 {
39-
// SAFETY: FFI call to krealloc.
39+
// SAFETY: FFI call.
4040
unsafe { bindings::krealloc(core::ptr::null(), size, bindings::GFP_KERNEL) as *mut u8 }
4141
}
4242

4343
#[no_mangle]
4444
pub fn __rust_dealloc(ptr: *mut u8, _size: usize, _align: usize) {
4545
// SAFETY: the caller must guarantee that `ptr` and `layout` denote memory
4646
// allocated by this allocator, so allocated with `kmalloc`.
47-
// FFI call to kfree
47+
// FFI call.
4848
unsafe { bindings::kfree(ptr as *const c_types::c_void) };
4949
}
5050

5151
#[no_mangle]
5252
pub fn __rust_realloc(ptr: *mut u8, _old_size: usize, _align: usize, new_size: usize) -> *mut u8 {
53-
// SAFETY: FFI call to krealloc.
53+
// SAFETY: FFI call.
5454
unsafe {
5555
bindings::krealloc(
5656
ptr as *const c_types::c_void,
@@ -62,7 +62,7 @@ pub fn __rust_realloc(ptr: *mut u8, _old_size: usize, _align: usize, new_size: u
6262

6363
#[no_mangle]
6464
pub fn __rust_alloc_zeroed(size: usize, _align: usize) -> *mut u8 {
65-
// SAFETY: FFI call to krealloc.
65+
// SAFETY: FFI call.
6666
unsafe {
6767
bindings::krealloc(
6868
core::ptr::null(),

0 commit comments

Comments
 (0)