linux-stable/rust/kernel
Alice Ryhl 8ba426f170 rust: fix signature of rust_fmt_argument
[ Upstream commit 901b3290bd ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-04-10 14:39:20 +02:00
..
alloc rust: alloc: satisfy POSIX alignment requirement 2025-03-22 12:54:23 -07:00
block rust: use custom FFI integer types 2025-03-13 13:01:49 +01:00
init rust: init: add missing newline to pr_info! calls 2025-03-22 12:54:26 -07:00
list rust: start using the #[expect(...)] attribute 2025-03-13 13:01:42 +01:00
net rust: use custom FFI integer types 2025-03-13 13:01:49 +01:00
sync rust: use custom FFI integer types 2025-03-13 13:01:49 +01:00
alloc.rs rust: alloc: update module comment of alloc.rs 2025-03-13 13:01:47 +01:00
block.rs
build_assert.rs
device.rs
error.rs rust: error: add missing newline to pr_warn! calls 2025-03-22 12:54:26 -07:00
firmware.rs rust: map long to isize and char to u8 2025-03-13 13:02:13 +01:00
init.rs rust: init: add missing newline to pr_info! calls 2025-03-22 12:54:26 -07:00
ioctl.rs rust: start using the #[expect(...)] attribute 2025-03-13 13:01:42 +01:00
kunit.rs
lib.rs rust: remove leftover mentions of the alloc crate 2025-03-22 12:54:23 -07:00
list.rs rust: enable clippy::undocumented_unsafe_blocks lint 2025-03-13 13:01:41 +01:00
net.rs
page.rs
prelude.rs rust: alloc: add Vec to prelude 2025-03-13 13:01:46 +01:00
print.rs rust: fix signature of rust_fmt_argument 2025-04-10 14:39:20 +02:00
rbtree.rs rust: treewide: switch to our kernel Box type 2025-03-13 13:01:44 +01:00
sizes.rs
static_assert.rs
std_vendor.rs rust: start using the #[expect(...)] attribute 2025-03-13 13:01:42 +01:00
str.rs rust: use custom FFI integer types 2025-03-13 13:01:49 +01:00
sync.rs rust: lockdep: Remove support for dynamically allocated LockClassKeys 2025-03-22 12:54:22 -07:00
task.rs rust: use custom FFI integer types 2025-03-13 13:01:49 +01:00
time.rs rust: use custom FFI integer types 2025-03-13 13:01:49 +01:00
types.rs rust: use custom FFI integer types 2025-03-13 13:01:49 +01:00
uaccess.rs rust: map long to isize and char to u8 2025-03-13 13:02:13 +01:00
workqueue.rs rust: treewide: switch to our kernel Box type 2025-03-13 13:01:44 +01:00