From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (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 A5B1A301016 for ; Thu, 25 Sep 2025 13:56:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758808576; cv=none; b=CDtpYQ3ZQJsibdZlt0jkE8Vvd0f+TOX0lmh+OjG1CnE55iMBmBlp0gXET+LbomVeJ1/earrjOH5JG8wKy3GJeggtBMeIB4j+S2y8Pdclr+Zkt3GWqueebdGwZiupQX7OkIDhN3oDXC1/j17+xOwEItTfDVofZbZOVko0ihawSC4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758808576; c=relaxed/simple; bh=O/wu2Lf29nUdzSaspIKYEix0WPxikVmVfF3mQ9scbuU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=p3QLYPKquKxIqOwxhOMiMUEmTO3R59B4T84vhvJI7m4PFzUJVE6/TlhEg2qg+G7XuoK9yI9CcuAchxUeqrg9qH4za2fLb0baxUM9ySQL9NLvT3LVkSg+eq4cBILk0DVHOobMV/VaJuQ/PB+UV68Nyx2aZ3+BfcIQ0YWBmPMFVtc= 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=MB0/rmK3; arc=none smtp.client-ip=209.85.222.178 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="MB0/rmK3" Received: by mail-qk1-f178.google.com with SMTP id af79cd13be357-858183680b4so125259385a.2 for ; Thu, 25 Sep 2025 06:56:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758808573; x=1759413373; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=67z28WQrX/ogTxUcpWCJ1GAunLtCBeF3o3dpHhKNjK8=; b=MB0/rmK3l+ZRaaJREG3duYQEux480HIjS3w7cDDn9IykqdqjNqzjOjDqQVDV0/G/4s UPQkg6GOHh6MdmyUN6KUCiYfeHXt7DkQt1w2k0lMIuHYcsWvF8ztNoFG/9gzlWWZH+F/ bvdDMJX9OXV4YCVBRzPmCkv84aUyg5kQxj24i5gOa0jFxhQ1URlSiQCapmMwlPYF6LCG aEEg39hR2APw6sgoqVJt4aYQ7gpqspPtBL8ekCXej+8wDl/h9lDuCqJ7XJWYmbiOEbg8 mgv7+3GJPG0OhDg7h8khmsT5dex/FwZGLyfFAa3f90dGucAi8zN50dLJkhBTAHTQN+LR wgnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758808573; x=1759413373; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=67z28WQrX/ogTxUcpWCJ1GAunLtCBeF3o3dpHhKNjK8=; b=PL/b8wVngGkGN7spKSyWY47K83g0JuP29ZDJSin9BWzJGIw/fwChZev5BFYIG8ZVoT YXXZBkyztKiR9XdrCZlIiKoLdPUVSs4eKh8QfsYa7csnTWZWooznEmgWt37L8jp6dYpn gAd39iHnzqL36cirCmBAZbIBtNdQFuziQ3JijqMTL/PaZU82Jf8Oc7YLH21+CpNp/2gF +EGiTWX3qcFajImH5s1x0igZfa3fB28flK95p2bnHh0gFmbttK0Zfx0Y9vshvwNmkwxS XDg0EMez4ilhWT+2uKh26BIAUAeNNFP5JqEdpFFAZ5biRAxdrfe4rGS6JCv3MBSOBehb L37w== X-Forwarded-Encrypted: i=1; AJvYcCX9VNEfXRJeM8Iy5n331OHX3Zir+fp+jhIhZ8Q9HJ9GrXVtFvtPMj0L9MjXgctmZ/tKX56npJTgPB1e6A==@vger.kernel.org X-Gm-Message-State: AOJu0YxZyUz3M9hpKCYqBT7VnNmhHmgWvHPJvHN4DbrvLO6Yw2Sn0E3B bEIYu5HX/w6MBBFZQ1YABGR6T64ApLG23PRk1ER/OuwVYCQuEVmuL3vC X-Gm-Gg: ASbGncvxv4Ou0NxxpG5a55KcoHuq19Mm18sa0TFq8GnA+Ey+5U/SLmkG9ByPeY+/sPo xVg3RzRb/GGUwquyi2VoW/fyGQzPQ+jAfmZVW3dYaqyis2WAafBhELMXZmiUeaou3qqwLkd84SP OaHlTm6PZ2DUt5YZtlRjgUvSY5dj931PTZvd/NErGjEuWkcK09Evcaik13ThhRFyeWIYIKXHIok utYXgUJdhcJox3Fy+xSjbzPsONbtk+TqA/cBj00yCOvydK56B5iQncm5qiwQkC58Gmj8HbM3AyT gwwEhrlHVYQEpplXx+cZ//JBR1PHM/DE+0bX2JTjmNTRUQnVZR8SpqPtlKCCaGLzGcf1k/hOE00 4FUqAwuS9htODB6VNbiGU9rQm0oRWIH5/1bX9SJ9E+J4mgGNah040nP2jtzF+A45r1S5qqOaFax TRtzjNJRYd48ZHalT8HmDRbI1sMGeecHc/TlWp/MJwGy2gIBB4aE8lce50sJ5ME+qqVhAI X-Google-Smtp-Source: AGHT+IFqm26OFmsSA0nKzITzw08x0KzoFRvLAeGfptjPnF7Ljbfyc5/369jW8FthqI8ZOsSRAhkw7g== X-Received: by 2002:a05:6214:1cc4:b0:786:e3b6:bb99 with SMTP id 6a1803df08f44-7fc3128e0c3mr48349976d6.29.1758808572677; Thu, 25 Sep 2025 06:56:12 -0700 (PDT) Received: from 137.1.168.192.in-addr.arpa ([2600:4808:6353:5c00:7c:b286:dba3:5ba8]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-80135968d5esm11536916d6.12.2025.09.25.06.56.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Sep 2025 06:56:12 -0700 (PDT) From: Tamir Duberstein Date: Thu, 25 Sep 2025 09:54:07 -0400 Subject: [PATCH v2 19/19] rust: regulator: replace `kernel::c_str!` with C-Strings Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20250925-core-cstr-cstrings-v2-19-78e0aaace1cd@gmail.com> References: <20250925-core-cstr-cstrings-v2-0-78e0aaace1cd@gmail.com> In-Reply-To: <20250925-core-cstr-cstrings-v2-0-78e0aaace1cd@gmail.com> To: "Rafael J. Wysocki" , Viresh Kumar , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , FUJITA Tomonori , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Michael Turquette , Stephen Boyd , Breno Leitao , Greg Kroah-Hartman , Luis Chamberlain , Russ Weight , Dave Ertman , Ira Weiny , Leon Romanovsky , Bjorn Helgaas , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Arnd Bergmann , Brendan Higgins , David Gow , Rae Moar , Jens Axboe , Alexandre Courbot , Alexander Viro , Christian Brauner , Jan Kara , Liam Girdwood , Mark Brown Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, netdev@vger.kernel.org, linux-clk@vger.kernel.org, linux-pci@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, Tamir Duberstein X-Mailer: b4 0.15-dev X-Developer-Signature: v=1; a=openssh-sha256; t=1758808439; l=2550; i=tamird@gmail.com; h=from:subject:message-id; bh=O/wu2Lf29nUdzSaspIKYEix0WPxikVmVfF3mQ9scbuU=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgtYz36g7iDMSkY5K7Ab51ksGX7hJgs MRt+XVZTrIzMVIAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QFsLawjfMUC3xaiUohpUXzdZt822yLFxnKyQ3hJFQI3UAkDtLeyUoqZ2lgOdZhmeuCD54hWBgXN /2qfobXSOOAA= X-Developer-Key: i=tamird@gmail.com; a=openssh; fpr=SHA256:264rPmnnrb+ERkS7DDS3tuwqcJss/zevJRzoylqMsbc C-String literals were added in Rust 1.77. Replace instances of `kernel::c_str!` with C-String literals where possible. Signed-off-by: Tamir Duberstein --- rust/kernel/regulator.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/rust/kernel/regulator.rs b/rust/kernel/regulator.rs index 65f3a125348f..dff8fb00566f 100644 --- a/rust/kernel/regulator.rs +++ b/rust/kernel/regulator.rs @@ -98,12 +98,11 @@ pub struct Error { /// /// ``` /// # use kernel::prelude::*; -/// # use kernel::c_str; /// # use kernel::device::Device; /// # use kernel::regulator::{Voltage, Regulator, Disabled, Enabled}; /// fn enable(dev: &Device, min_voltage: Voltage, max_voltage: Voltage) -> Result { /// // Obtain a reference to a (fictitious) regulator. -/// let regulator: Regulator = Regulator::::get(dev, c_str!("vcc"))?; +/// let regulator: Regulator = Regulator::::get(dev, c"vcc")?; /// /// // The voltage can be set before enabling the regulator if needed, e.g.: /// regulator.set_voltage(min_voltage, max_voltage)?; @@ -142,12 +141,11 @@ pub struct Error { /// /// ``` /// # use kernel::prelude::*; -/// # use kernel::c_str; /// # use kernel::device::Device; /// # use kernel::regulator::{Voltage, Regulator, Enabled}; /// fn enable(dev: &Device) -> Result { /// // Obtain a reference to a (fictitious) regulator and enable it. -/// let regulator: Regulator = Regulator::::get(dev, c_str!("vcc"))?; +/// let regulator: Regulator = Regulator::::get(dev, c"vcc")?; /// /// // Dropping an enabled regulator will disable it. The refcount will be /// // decremented. @@ -193,7 +191,6 @@ pub struct Error { /// /// ``` /// # use kernel::prelude::*; -/// # use kernel::c_str; /// # use kernel::device::Device; /// # use kernel::regulator::{Regulator, Dynamic}; /// struct PrivateData { @@ -203,7 +200,7 @@ pub struct Error { /// // A fictictious probe function that obtains a regulator and sets it up. /// fn probe(dev: &Device) -> Result { /// // Obtain a reference to a (fictitious) regulator. -/// let mut regulator = Regulator::::get(dev, c_str!("vcc"))?; +/// let mut regulator = Regulator::::get(dev, c"vcc")?; /// /// Ok(PrivateData { regulator }) /// } -- 2.51.0