Skip to content

Commit ca264fe

Browse files
KunWuChanriteshharjani
authored andcommitted
rust: optimize rust symbol generation for SeqFile
When build the kernel using the llvm-18.1.3-rust-1.85.0-x86_64 with ARCH=arm64, the following symbols are generated: $nm vmlinux | grep ' _R'.*SeqFile | rustfilt ffff8000805b78ac T <kernel::seq_file::SeqFile>::call_printf This Rust symbol is trivial wrappers around the C functions seq_printf. It doesn't make sense to go through a trivial wrapper for its functions, so mark it inline. Link: Rust-for-Linux#1145 Suggested-by: Alice Ryhl <[email protected]> Co-developed-by: Grace Deng <[email protected]> Signed-off-by: Grace Deng <[email protected]> Signed-off-by: Kunwu Chan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Alice Ryhl <[email protected]> Reviewed-by: Benno Lossin <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent f45c836 commit ca264fe

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

rust/kernel/seq_file.rs

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ impl SeqFile {
3030
}
3131

3232
/// Used by the [`seq_print`] macro.
33+
#[inline]
3334
pub fn call_printf(&self, args: core::fmt::Arguments<'_>) {
3435
// SAFETY: Passing a void pointer to `Arguments` is valid for `%pA`.
3536
unsafe {

0 commit comments

Comments
 (0)