]> www.infradead.org Git - users/jedix/linux-maple.git/commit
cred,rust: mark Credential methods inline
authorAlice Ryhl <aliceryhl@google.com>
Tue, 4 Mar 2025 10:25:13 +0000 (10:25 +0000)
committerPaul Moore <paul@paul-moore.com>
Tue, 4 Mar 2025 22:07:49 +0000 (17:07 -0500)
commitab938b59e9de924de20ba4a8f768649573421204
treed0ae46a90c0077d13d325f5f7517bf0bdf036fa9
parent0a01beac927a1920487e40a2f9577e871261d89b
cred,rust: mark Credential methods inline

When you build the kernel using the llvm-19.1.4-rust-1.83.0-x86_64
toolchain provided by kernel.org with ARCH=arm64, the following symbols
are generated:

$ nm out-linux/vmlinux | grep ' _R'.*Credential | rustfilt
... T <kernel::cred::Credential>::get_secid
... T <kernel::cred::Credential as
        kernel::types::AlwaysRefCounted>::dec_ref
... T <kernel::cred::Credential as
        kernel::types::AlwaysRefCounted>::inc_ref

However, these Rust symbols are trivial wrappers around the functions
security_cred_getsecid, get_cred, and put_cred respectively. It doesn't
make sense to go through a trivial wrapper for these functions, so mark
them inline. Also mark other trivial methods inline to prevent similar
cases in the future.

After applying this patch, the above command will produce no output.

Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
[PM: subject tweak, description line trims]
Signed-off-by: Paul Moore <paul@paul-moore.com>
rust/kernel/cred.rs