linux/rust/kernel
Alice Ryhl 901b3290bd rust: fix signature of rust_fmt_argument
Without this change, the rest of this series will emit the following
error message:

error[E0308]: `if` and `else` have incompatible types
  --> <linux>/rust/kernel/print.rs:22:22
   |
21 | #[export]
   | --------- expected because of this
22 | unsafe extern "C" fn rust_fmt_argument(
   |                      ^^^^^^^^^^^^^^^^^ expected `u8`, found `i8`
   |
   = note: expected fn item `unsafe extern "C" fn(*mut u8, *mut u8, *mut c_void) -> *mut u8 {bindings::rust_fmt_argument}`
              found fn item `unsafe extern "C" fn(*mut i8, *mut i8, *const c_void) -> *mut i8 {print::rust_fmt_argument}`

The error may be different depending on the architecture.

To fix this, change the void pointer argument to use a const pointer,
and change the imports to use crate::ffi instead of core::ffi for
integer types.

Fixes: 787983da77 ("vsprintf: add new `%pA` format specifier")
Reviewed-by: Tamir Duberstein <tamird@gmail.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20250303-export-macro-v3-1-41fbad85a27f@google.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2025-03-09 20:52:46 +01:00
..
alloc rust: alloc: make ReallocFunc::call inline 2025-03-06 20:49:06 +01:00
block Rust changes for v6.14 2025-01-21 17:48:03 -08:00
fs rust: improve lifetimes markup 2025-03-08 23:04:38 +01:00
init rust: treewide: switch to our kernel Box type 2024-10-15 22:56:59 +02:00
list rust: use derive(CoercePointee) on rustc >= 1.84.0 2025-01-13 23:45:30 +01:00
net Networking changes for 6.14. 2025-01-22 08:28:57 -08:00
sync rust: improve lifetimes markup 2025-03-08 23:04:38 +01:00
.gitignore rust: jump_label: skip formatting generated file 2024-11-20 13:32:42 -05:00
alloc.rs rust: use derive(CoercePointee) on rustc >= 1.84.0 2025-01-13 23:45:30 +01:00
block.rs rust: block: introduce kernel::block::mq module 2024-06-14 07:45:04 -06:00
build_assert.rs rust: add build_error! to the prelude 2025-01-10 00:19:09 +01:00
cred.rs rust: file: add Kuid wrapper 2024-09-30 13:02:29 +02:00
device.rs Driver core and debugfs updates 2025-01-28 12:25:12 -08:00
device_id.rs rust: implement IdArray, IdTable and RawDeviceId 2024-12-20 17:19:25 +01:00
devres.rs rust: devres: remove action in Devres::drop 2025-01-10 15:49:06 +01:00
driver.rs rust: driver: address soundness issue in RegistrationOps 2025-01-07 11:31:45 +01:00
error.rs rust: error: import kernel's LayoutError instead of core's 2025-01-13 23:45:13 +01:00
faux.rs rust/kernel: Add faux device bindings 2025-02-13 16:58:58 +01:00
firmware.rs rust: map long to isize and char to u8 2024-12-16 21:49:33 +01:00
fs.rs rust: file: add Rust abstraction for struct file 2024-09-30 13:02:28 +02:00
generated_arch_static_branch_asm.rs.S rust: jump_label: skip formatting generated file 2024-11-20 13:32:42 -05:00
init.rs rust: init: use explicit ABI to clean warning in future compilers 2025-02-06 00:15:49 +01:00
io.rs rust: add io::{Io, IoRaw} base types 2024-12-20 17:19:26 +01:00
ioctl.rs rust: start using the #[expect(...)] attribute 2024-10-07 21:39:57 +02:00
jump_label.rs rust: jump_label: skip formatting generated file 2024-11-20 13:32:42 -05:00
kunit.rs rust: kunit: use C-string literals to clean warning 2024-10-01 23:46:42 +02:00
lib.rs rust/kernel: Add faux device bindings 2025-02-13 16:58:58 +01:00
list.rs rust: list: make the cursor point between elements 2025-03-08 22:35:34 +01:00
miscdevice.rs Driver core and debugfs updates 2025-01-28 12:25:12 -08:00
net.rs rust: core abstractions for network PHY drivers 2023-12-15 09:35:50 +00:00
of.rs rust: of: add of::DeviceId abstraction 2024-12-20 17:21:04 +01:00
page.rs rust: page: remove unnecessary helper function from doctest 2025-01-13 23:44:55 +01:00
pci.rs rust: driver: address soundness issue in RegistrationOps 2025-01-07 11:31:45 +01:00
pid_namespace.rs rust: add PidNamespace 2024-10-08 15:44:36 +02:00
platform.rs rust: driver: address soundness issue in RegistrationOps 2025-01-07 11:31:45 +01:00
prelude.rs rust: add build_error! to the prelude 2025-01-10 00:19:09 +01:00
print.rs rust: fix signature of rust_fmt_argument 2025-03-09 20:52:46 +01:00
rbtree.rs rust: improve lifetimes markup 2025-03-08 23:04:38 +01:00
revocable.rs rust: add Revocable type 2024-12-20 17:19:26 +01:00
security.rs rust: finish using custom FFI integer types 2024-12-16 21:48:45 +01:00
seq_file.rs rust: improve lifetimes markup 2025-03-08 23:04:38 +01:00
sizes.rs rust: sizes: add commonly used constants 2024-08-30 10:27:34 +01:00
static_assert.rs rust: static_assert: add static_assert! macro 2022-12-04 01:59:16 +01:00
std_vendor.rs rust: std_vendor: update dbg macro from Rust upstream 2024-10-10 00:33:42 +02:00
str.rs rust: str: replace unwraps with question mark operators 2025-01-13 23:45:05 +01:00
sync.rs Driver core and debugfs updates 2025-01-28 12:25:12 -08:00
task.rs rust: task: make Pid type alias public 2025-03-06 20:59:45 +01:00
time.rs rust: use custom FFI integer types 2024-11-10 23:58:00 +01:00
tracepoint.rs rust: add tracepoint support 2024-11-04 16:21:44 -05:00
transmute.rs rust: kernel: move FromBytes and AsBytes traits to a new transmute module 2024-10-10 00:33:42 +02:00
types.rs rust: improve lifetimes markup 2025-03-08 23:04:38 +01:00
uaccess.rs rust: uaccess: generalize userSliceReader to support any Vec 2025-01-13 23:46:23 +01:00
workqueue.rs Rust changes for v6.14 2025-01-21 17:48:03 -08:00