Re: [PATCH] rust: pci: Mark Device refcount methods inline

From: Alice Ryhl

Date: Wed Aug 05 2026 - 03:57:02 EST


On Wed, Aug 5, 2026 at 1:24 AM Ethan Plant via B4 Relay
<devnull+plant.ethan.gmail.com@xxxxxxxxxx> wrote:
>
> From: Ethan Plant <plant.ethan@xxxxxxxxx>
>
> When building the kernel, the following Rust symbols are generated:
> $ nm vmlinux | grep ' _R' | rustfilt | grep -E 'pci::Device.*(inc_ref|dec_ref)'
> ... T <kernel::pci::Device as kernel::sync::aref::AlwaysRefCounted>::dec_ref
> ... T <kernel::pci::Device as kernel::sync::aref::AlwaysRefCounted>::inc_ref
>
> These Rust symbols are trivial wrappers around pci_dev_put() and
> pci_dev_get(), respectively. It doesn't make sense to go through a
> trivial wrapper for these functions, so mark them inline.
>
> Suggested-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> Link: https://github.com/Rust-for-Linux/linux/issues/1145
> Signed-off-by: Ethan Plant <plant.ethan@xxxxxxxxx>

Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>