From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) (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 369862874F3 for ; Thu, 25 Sep 2025 13:54:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758808483; cv=none; b=adKG4TK8s5LwVunReYjnU+1NdCOLeVXV0eJzQ1DrmHRDSfUS7cNppUu7PG1QR00yTuckqrGLnxBlxuYRttb9Oez5O2VZTS9OVhbvuYJeTsCc2TI9mEAntBlVx8zbbE8CJLdNOBuKpAAkABwX1m3zhxDUhed+8uoUQWKDDZlVCyg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758808483; c=relaxed/simple; bh=bBVznekpj7qdZ0+04IhJTyz4wbdj27t8Hhu1jfona5I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Zp3qmp+KgdLliCJwfBc1rvXwK8A1S4P4E2XA0Pz8pnOzJ8Ft5k1eURag181WopLqlWx4QIIMZ81eTb2IoC70qY1T7iuwcAPEPyiLchzN6XM12dUtmiPEsB2obWOuzqsVEEaekN2xC4HgbF2s2yVRtlM2P1D4o8VdJ1K/2MiS4Hk= 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=JGvqmg2F; arc=none smtp.client-ip=209.85.219.43 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="JGvqmg2F" Received: by mail-qv1-f43.google.com with SMTP id 6a1803df08f44-78f58f4230cso7292606d6.1 for ; Thu, 25 Sep 2025 06:54:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758808480; x=1759413280; 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=r6lalX/iBRsGnpItoRbVPuxYp6EIBWS28tOUXJUE06A=; b=JGvqmg2FjpGnums7f9TtB91ZEHDxTDHKw5ZM2KiCeGnwDIKrxIWYi7oHNZ3VFYWtvw XaS34WAygmxNW3LOyTf7QTI6sc4u/zxOtwCJJ5iWmNL1bc+P6qBsNlSUstqD0Ic3jjjc S2wvXBH8DP5tN9ehtUeGsF3xwKkjGHkvQeVtet9YibnqfNA7DrGcEvOZntMMmaj3yGed GYqnxdeL2pnRx4UnDjbgutLucrIsneP96Nzjanj+qaaSNO11aLaAmhY4trCpE+PH4aKE Q0MqeM/uH1uCNuXTnQ3LBFtMA76FL+9wavqqpDnbyUt89PFtZQvCyXt8w8h4KwK9A1hC m7ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758808480; x=1759413280; 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=r6lalX/iBRsGnpItoRbVPuxYp6EIBWS28tOUXJUE06A=; b=m0fb3EsUHueKc+0dKInztWLTpPczWKOeeCbcB1U5WZBbESxvkIw25IvZCNuXRdyI2n 1Q364vIOTSvGlXPlYy4+eXpyfs1eJVu+M0pqzjGAoNz+dnDy8agdLluFzLnIK4sp5duB WOWp+wJJ00lbSFV9L93pQPsFtIOhcy0MWDRI6F+wb1m2bPkoVl5t4ZF2YAFuWfwvwXbW bjezcxOxpc4ipoWN0NVZJvUSioP5KEaqBSX3ShHLcv8po9c7+azSrMQ3dJr/vpVqsTQA gt5mUXQh5T3zwNLhkj6WX7TFBdZtf1NxU5FZ01/gANqPbkrlnsabxQTH6jW4HFatn7c/ XLVg== X-Forwarded-Encrypted: i=1; AJvYcCWePdNSwsXGMXM8eiO0x10lOhy3112gy6tQ/Tt++zq7pPgspi3IFM64hF8G+pmvkR+66LnAv7rWsj9RXI4gLQ==@vger.kernel.org X-Gm-Message-State: AOJu0YwpKltZ1QX1ZNkwEGNtiq4nYgTE3rifDO/NbBvqfXdPga0ITuu6 LQWMlBtHGpI6RJfGaj0HMJ57e0UgYMOsSJhmCKkCNIbVOoZMVIqKG01J X-Gm-Gg: ASbGnctcOrfU6BhWX8K+DpdqltOwNa8gMgX2FgUxb6l0R5tBt/FRzoty1WRMW9wFuO8 O1yGXQsli/ig2ieA5jef/zXvV0vIQWvWJPH6vXloGeaz463r1Z3QXEM7F2V2G8qYUgtyfBaQFZo cuDUb7lNGWyuP+a6ATZO+oz6tmEn93ZtAZ2F+TNm91PhBvJ331NYtSdIQgSBbGPve9JxeJVMWwc 7Po/Lw8pljPaR7xjsgPw1NlRN2E1YwA9EIBdjud7JxOEuOUQA0vZ4egz2DVAuKAabZQsh+F+l4e RbPl7EHYhndanCagfstNfOyNXZdfWUTB4lqz8qUCyBeOjIbU811x0n5G9cEQyQYAQn4z3IBfhum 7tUUpbuprozVbdpTTckJyysJPeZ+5tfyi70K02vLCPxp9VkMw6sX0/0e10/fI5LzH+EUyrzFQj8 rEISOR9YtOvVLAiVFk4KBpXWWFC1AxyiZG7VbnD/47lBgp6BKdD30REOQ4JnwlrpjgPv4j X-Google-Smtp-Source: AGHT+IHepv29FfYPtTdxgOoNZgUW8YipGs8v8IsYeK+WMtrN5j7d3Ey2ZO1H0B0PLPCt/i6MFpqqEg== X-Received: by 2002:a05:6214:e44:b0:782:1086:f659 with SMTP id 6a1803df08f44-7fc39463963mr48276926d6.26.1758808479997; Thu, 25 Sep 2025 06:54:39 -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.54.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Sep 2025 06:54:39 -0700 (PDT) From: Tamir Duberstein Date: Thu, 25 Sep 2025 09:53:52 -0400 Subject: [PATCH v2 04/19] rust: clk: replace `kernel::c_str!` with C-Strings Precedence: bulk X-Mailing-List: rust-for-linux@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-4-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=1758808437; l=1787; i=tamird@gmail.com; h=from:subject:message-id; bh=bBVznekpj7qdZ0+04IhJTyz4wbdj27t8Hhu1jfona5I=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgtYz36g7iDMSkY5K7Ab51ksGX7hJgs MRt+XVZTrIzMVIAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QIaSBovkrkMRrRLSQD5J+u5uy+nbEnxtyP0CB8hGaKgQan89NKIGBwidRQmE8SW0OYKsdw9ArOG kkgFhmd1d2QA= 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. Acked-by: Greg Kroah-Hartman Reviewed-by: Alice Ryhl Reviewed-by: Benno Lossin Acked-by: Stephen Boyd Acked-by: Viresh Kumar Signed-off-by: Tamir Duberstein --- rust/kernel/clk.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rust/kernel/clk.rs b/rust/kernel/clk.rs index 1e6c8c42fb3a..09469277e95b 100644 --- a/rust/kernel/clk.rs +++ b/rust/kernel/clk.rs @@ -104,13 +104,12 @@ mod common_clk { /// The following example demonstrates how to obtain and configure a clock for a device. /// /// ``` - /// use kernel::c_str; /// use kernel::clk::{Clk, Hertz}; /// use kernel::device::Device; /// use kernel::error::Result; /// /// fn configure_clk(dev: &Device) -> Result { - /// let clk = Clk::get(dev, Some(c_str!("apb_clk")))?; + /// let clk = Clk::get(dev, Some(c"apb_clk"))?; /// /// clk.prepare_enable()?; /// @@ -272,13 +271,12 @@ fn drop(&mut self) { /// device. The code functions correctly whether or not the clock is available. /// /// ``` - /// use kernel::c_str; /// use kernel::clk::{OptionalClk, Hertz}; /// use kernel::device::Device; /// use kernel::error::Result; /// /// fn configure_clk(dev: &Device) -> Result { - /// let clk = OptionalClk::get(dev, Some(c_str!("apb_clk")))?; + /// let clk = OptionalClk::get(dev, Some(c"apb_clk"))?; /// /// clk.prepare_enable()?; /// -- 2.51.0