From nobody Sun May 24 17:49:38 2026 Received: from mail-vk1-f179.google.com (mail-vk1-f179.google.com [209.85.221.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB457397AE5 for ; Sun, 24 May 2026 15:41:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779637304; cv=none; b=UCxIWKuYdE77KlQFZgUk0GuCRm8ajae+c3rwxUG1QwiYckfaD1qTkbGjkPpZpg3LuqXFvqNwAITYEr3Z/5hAge60UPWYRYk8xaQXF0q+RegiFL6m1o9oQWCPm2bxYQ4sblBZJvuhU3/jSQYXh34wmbRjRBK1c/MVaRF8Dgn6fi8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779637304; c=relaxed/simple; bh=LP+8poHVh9zbjYuek8fKJ279TAcL7jm45h440IQz+Gg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=XGgTbZdkdmYPV8tFRw9Ouz6iuMNaqrFM7WFlMfU/5yPSIgTneD/0pp9CbD7BTCTGiKZL+zlTnzxrO3HU6lyy1zgJst+m6wBJjmdoSH5VbL8xu6K+3MLmgwGJQ7IOCkIMMHk4h4uczjbTfPmn5dz82GZeplR8w670JvMZCmg/ja4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=id43rStp; arc=none smtp.client-ip=209.85.221.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="id43rStp" Received: by mail-vk1-f179.google.com with SMTP id 71dfb90a1353d-5873983d19eso2164908e0c.2 for ; Sun, 24 May 2026 08:41:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779637302; x=1780242102; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=QETOjP8nSu5eBP6GGmjCPAaYCLzkQOtWRPWzeg//2ZU=; b=id43rStpdcOaLZcDNy37UfEr59a42gmeG3VVvLGcTa8S6Ov6zd3YrWH9sxvqVRkUO0 +OT3aCELIfz31AEniedNby/stq8YxBErjI8YHBLBwMUHoWopqOlizn59AOiiQdXNtljB LLwUDRpBiaN3llpORk7+Zbe62Brv5UdubSix/t8rmpsj7VWshNToFy4DNuSKbxStLLnP KSrJFn9PZlawILud6319J5FP38nB6hPM5r5KsiUEGiBFNr4TUSB+MowYslexAJazVHWz UzSACBGJz0SuJne6njsaVIKYX9dNIcbEWMoiXLX+rOENabJTUqbwX2KgBPJddU6vH3Us q/HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779637302; x=1780242102; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=QETOjP8nSu5eBP6GGmjCPAaYCLzkQOtWRPWzeg//2ZU=; b=ipFp3s4s5jSKCzKPK5u+a7BOLY8AgJKkhzMqqO2e52pS8849wFtRt+u6ufd9lm5G9/ LR0J8sxwWOlpOWkVoD6GQp0HaRLN2RvsKtbJ5qAe8gSqDBHeZcCKkyogsdFP1BKszvMj k9Ydo4aw9aHuULEA/qXNci1k7iI4V1DW19x4fa8/AHk14T+VLfLqqiHH8Erbrx4l2W6w f+arEBYxSAte+04AThd0gyCKzMJEbGf7xBSMykdkKSaral3vIs8X3ryhhTJB2SsVraPe wmL/Fn0bhTe9U3LEFLbMKZfCkJh8x5YsIi8izyVCn/4Q4+cMvxd8HMDcmZUKvhtgQr+V gOAw== X-Forwarded-Encrypted: i=1; AFNElJ8L3e9rY/efFOpjk2cTlhh7jYM47/WLInQ1GZELjRrtlOo7SPr738CrZfWCM3Av6m3+vnVJWt3Uwjcvn40=@vger.kernel.org X-Gm-Message-State: AOJu0YwoIJKqO1jrliNuhrljQSevVdx2cr/xMmCtc57U8rzhS73HOiFN 0z5hdAREhfhJmb9mkDoni/z58JRs86VXuZmEJHnAya6OFyEXfsYARfg= X-Gm-Gg: Acq92OHBoR/Kh0ruJTXKQCdMzNQnCu1b62bC/f581XHzyFd3HlRZ9j6mvQDuWnBQteN 0rw4CLTS36O5lSGoD9l350K2TZ42gGQrTbzF/gFRiU85AbmqqpuiV/bXq8UI9KSKvttAwMoAaM5 NSt7plUO0TxGa5NmZKiXj4IufAUz7oQQb9frNOxbCn771A4MMORX5D6Lv6Ksy9INLlNdhfUXt+T 3AvVFb0MJe0cKKHcp3PRrp22I8KOq5R/KxUV60D4pND5fW/djptVKq2D6YgIVOVOgfeCoFNl56Z /G2uoJiixGB4mWX8lYz95VwYQ+a1NcNVp15WNRgecuoLA+vns4EkL/s3fwUvI5ncDU7NlC8GWNY M+2OuptYPtNhE+oEDTtoIBXTJUl4oFHRZWPy8EIQcnIvXXgeqFVWR3fWNBe1cW3egkfwu7EKtaA MuJUQwmdNFP482uJDaAEO9Djxct35zrLLGvjdKzfrWtx03hLghBz7S3MJhZ6I/ X-Received: by 2002:a05:6122:4317:b0:576:1a8d:8989 with SMTP id 71dfb90a1353d-58658a3d6f0mr6262665e0c.0.1779637300919; Sun, 24 May 2026 08:41:40 -0700 (PDT) Received: from linux-dev ([186.158.238.108]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-586f23ee48esm9115364e0c.3.2026.05.24.08.41.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2026 08:41:40 -0700 (PDT) From: =?UTF-8?q?Nicol=C3=A1s=20Antinori?= To: Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: =?UTF-8?q?Nicol=C3=A1s=20Antinori?= , Alice Ryhl , Andreas Hindborg , Benno Lossin , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Boqun Feng , Danilo Krummrich , Gary Guo , Miguel Ojeda , Trevor Gross , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, rust-for-linux@vger.kernel.org Subject: [PATCH] opp: rust: mark OPP methods as inline Date: Sun, 24 May 2026 12:40:16 -0300 Message-ID: <20260524154021.34096-1-nico.antinori.7@gmail.com> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable When building the kernel using llvm-19.1.7-rust-1.85.0-x86_64, the following symbols are generated: $ nm vmlinux | grep ' _R'.*OPP | rustfilt ffffffff81801560 T ::freq ffffffff81801540 T ::dec_ref ffffffff81801520 T ::inc_ref However, these Rust symbols are trivial wrappers around the `dev_pm_opp_get`, `dev_pm_opp_put` and `dev_pm_opp_get_freq_indexed` functions. It doesn't make sense to go through a trivial wrapper for these functions. After applying this patch, the above command will produce no output. Link: https://github.com/Rust-for-Linux/linux/issues/1145 Suggested-by: Alice Ryhl Signed-off-by: Nicol=C3=A1s Antinori --- rust/kernel/opp.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rust/kernel/opp.rs b/rust/kernel/opp.rs index a760fac28765..62e44676125d 100644 --- a/rust/kernel/opp.rs +++ b/rust/kernel/opp.rs @@ -1042,11 +1042,13 @@ unsafe impl Sync for OPP {} =20 /// SAFETY: The type invariants guarantee that [`OPP`] is always refcounte= d. unsafe impl AlwaysRefCounted for OPP { + #[inline] fn inc_ref(&self) { // SAFETY: The existence of a shared reference means that the refc= ount is nonzero. unsafe { bindings::dev_pm_opp_get(self.0.get()) }; } =20 + #[inline] unsafe fn dec_ref(obj: ptr::NonNull) { // SAFETY: The safety requirements guarantee that the refcount is = nonzero. unsafe { bindings::dev_pm_opp_put(obj.cast().as_ptr()) } @@ -1095,6 +1097,7 @@ fn as_raw(&self) -> *mut bindings::dev_pm_opp { } =20 /// Returns the frequency of an [`OPP`]. + #[inline] pub fn freq(&self, index: Option) -> Hertz { let index =3D index.unwrap_or(0); =20 --=20 2.53.0