Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: finish using custom FFI integer types

In the last kernel cycle we migrated most of the `core::ffi` cases in
commit d072acda4862 ("rust: use custom FFI integer types"):

Currently FFI integer types are defined in libcore. This commit
creates the `ffi` crate and asks bindgen to use that crate for FFI
integer types instead of `core::ffi`.

This commit is preparatory and no type changes are made in this
commit yet.

Finish now the few remaining/new cases so that we perform the actual
remapping in the next commit as planned.

Acked-by: Jocelyn Falempe <jfalempe@redhat.com> # drm
Link: https://lore.kernel.org/rust-for-linux/CANiq72m_rg42SvZK=bF2f0yEoBLVA33UBhiAsv8THhVu=G2dPA@mail.gmail.com/
Link: https://lore.kernel.org/all/cc9253fa-9d5f-460b-9841-94948fb6580c@redhat.com/
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

+8 -12
+1 -1
drivers/gpu/drm/drm_panic_qr.rs
··· 931 931 /// They must remain valid for the duration of the function call. 932 932 #[no_mangle] 933 933 pub unsafe extern "C" fn drm_panic_qr_generate( 934 - url: *const i8, 934 + url: *const kernel::ffi::c_char, 935 935 data: *mut u8, 936 936 data_len: usize, 937 937 data_size: usize,
+2 -2
rust/kernel/device.rs
··· 173 173 #[cfg(CONFIG_PRINTK)] 174 174 unsafe { 175 175 bindings::_dev_printk( 176 - klevel as *const _ as *const core::ffi::c_char, 176 + klevel as *const _ as *const crate::ffi::c_char, 177 177 self.as_raw(), 178 178 c_str!("%pA").as_char_ptr(), 179 - &msg as *const _ as *const core::ffi::c_void, 179 + &msg as *const _ as *const crate::ffi::c_void, 180 180 ) 181 181 }; 182 182 }
+2 -6
rust/kernel/miscdevice.rs
··· 11 11 use crate::{ 12 12 bindings, 13 13 error::{to_result, Error, Result, VTABLE_DEFAULT_ERROR}, 14 + ffi::{c_int, c_long, c_uint, c_ulong}, 14 15 prelude::*, 15 16 str::CStr, 16 17 types::{ForeignOwnable, Opaque}, 17 18 }; 18 - use core::{ 19 - ffi::{c_int, c_long, c_uint, c_ulong}, 20 - marker::PhantomData, 21 - mem::MaybeUninit, 22 - pin::Pin, 23 - }; 19 + use core::{marker::PhantomData, mem::MaybeUninit, pin::Pin}; 24 20 25 21 /// Options for creating a misc device. 26 22 #[derive(Copy, Clone)]
+1 -1
rust/kernel/security.rs
··· 19 19 /// successful call to `security_secid_to_secctx`, that has not yet been destroyed by calling 20 20 /// `security_release_secctx`. 21 21 pub struct SecurityCtx { 22 - secdata: *mut core::ffi::c_char, 22 + secdata: *mut crate::ffi::c_char, 23 23 seclen: usize, 24 24 } 25 25
+1 -1
rust/kernel/seq_file.rs
··· 36 36 bindings::seq_printf( 37 37 self.inner.get(), 38 38 c_str!("%pA").as_char_ptr(), 39 - &args as *const _ as *const core::ffi::c_void, 39 + &args as *const _ as *const crate::ffi::c_void, 40 40 ); 41 41 } 42 42 }
+1 -1
samples/rust/rust_print_main.rs
··· 83 83 } 84 84 85 85 mod trace { 86 - use core::ffi::c_int; 86 + use kernel::ffi::c_int; 87 87 88 88 kernel::declare_trace! { 89 89 /// # Safety