From nobody Tue Feb 10 16:17:56 2026 Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [80.241.56.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 458BB1D90C8; Mon, 10 Mar 2025 19:51:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741636310; cv=none; b=eY5tf4AjEaFvhvLBJM1HnbcluMwzrQKFg2qgq8AQihzSJpFeKBBN27RIzUdCROZ6SCfBd0xHROId/Z+viyjWsIFgoGYei8lFmPdsHfym7r+PXG0b4f+kdY7tdD9xbd43KtYlRcZ1GtSgFEWx8ZkSoJ3N0tsgt9aphA9sjLTnYBU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741636310; c=relaxed/simple; bh=aD+sDt1ciaV119MjNuVJLFWgQduPhmrVJV35QOG6p+8=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=KqdihBYJI3RGO3126LT6pSLamMOnLW8Zb9T989k5Bm5vTr7Nyfa2t5Sbhw6CqyEFenml7+5IsSeHtZ2aVDLluJEruY07Y/4ft3XF5/pdBeS63VMbL8FYQqyPOMVARjvy+d+6HpzM0DzYzHOOY/NoHigrrAeYJrWJhM8FFgj58EQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ethancedwards.com; spf=pass smtp.mailfrom=ethancedwards.com; dkim=pass (2048-bit key) header.d=ethancedwards.com header.i=@ethancedwards.com header.b=tcPcy/DZ; arc=none smtp.client-ip=80.241.56.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ethancedwards.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ethancedwards.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ethancedwards.com header.i=@ethancedwards.com header.b="tcPcy/DZ" Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4ZBSFq21YDz9t1w; Mon, 10 Mar 2025 20:51:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ethancedwards.com; s=MBO0001; t=1741636303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=gv+550w/d+lXAHcItL5V3U21dqpQZG15UW/W7rQZH1s=; b=tcPcy/DZPBAG5uqdt6nK+gR3DIMtN0wjp5BACaXLTXS8RDlIb3KTfMz9+dKwMvTpEaHdEx 34unUgAfVqVk50lMP5FsUnoFAHKpp3hLXPYM0nBPIrVfPZ8qq+5NXG4JiwIKoHqKMgWzfz 1wwUOiCbou30K6ZbIUUYFkmhKJjHcEZdxEjjl9tOG0QDaGfC4219raAWkAotkUyp6p8VM0 IS1+FCS+Db11WZbsPOiYACRJPTiBS99Cj+BeWWmH9WzuJ1U3DTZvDUeX76afBc4CCIGmaW YWN29mr4xC/p15H9+d5CTiq8ZgBj+CIWupkOnUSrhFw5l5nk8kzvDn/WnfWGpg== Date: Mon, 10 Mar 2025 15:51:38 -0400 From: Ethan Carter Edwards To: Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?B?PT91dGYtOD9xP0JqPUMzPUI2cm5fUm95X0Jhcm9uPz0=?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, ethan@ethancedwards.com Subject: [PATCH v2] rust/kernel/faux: mark Registration methods inline Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When building the kernel on Arch Linux using on x86_64 with tools: $ rustc --version rustc 1.84.0 (9fc6b4312 2025-01-07) $ cargo --version cargo 1.84.0 (66221abde 2024-11-19) $ clang --version clang version 19.1.7 Target: x86_64-pc-linux-gnu The following symbols are generated: $ nm vmlinux | rg ' _R' | rustfilt | rg faux ffffffff81959ae0 T ::new ffffffff81959b40 T ::d= rop However, these Rust symbols are wrappers around bindings in the C faux code. Inlining these functions removes the middle-man wrapper function After applying this patch, the above function signatures disappear. Link: https://github.com/Rust-for-Linux/linux/issues/1145 Signed-off-by: Ethan Carter Edwards Acked-by: Danilo Krummrich Reviewed-by: Alice Ryhl --- v2: rebase on linux-next-20250307 --- rust/kernel/faux.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rust/kernel/faux.rs b/rust/kernel/faux.rs index 3277f35c3f79..8a50fcd4c9bb 100644 --- a/rust/kernel/faux.rs +++ b/rust/kernel/faux.rs @@ -23,6 +23,7 @@ =20 impl Registration { /// Create and register a new faux device with the given name. + #[inline] pub fn new(name: &CStr, parent: Option<&device::Device>) -> Result { // SAFETY: // - `name` is copied by this function into its own storage @@ -58,6 +59,7 @@ fn as_ref(&self) -> &device::Device { } =20 impl Drop for Registration { + #[inline] fn drop(&mut self) { // SAFETY: `self.0` is a valid registered faux_device via our type= invariants. unsafe { bindings::faux_device_destroy(self.as_raw()) } --=20 2.48.1