From nobody Thu Oct 2 02:05:51 2025 Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (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 14DBB2D6409 for ; Thu, 25 Sep 2025 13:55:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758808534; cv=none; b=iIHxEkBraCMT+JLEZGi95CSlqyKCkfGHYLUzQeKfWmko3ZEgIPWQp9QqAhYK7hThkWTjmlmNQh47xqSbEAGQvISd97PSR72yfoqJMhiUXbLkNJS65RFTAysQ66delURKQHxDrUXTVJUBXzSYW00gH09qfZEQgvQjPfF3GKXwVJk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758808534; c=relaxed/simple; bh=D/F3RUnYNMNKrZc7ezIrEwfyGQmWHVwyjceS6shQSWA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Xhqr8edJEqu2N4P9MaXFfOH1ONI34/9gL72uKVt+0Om1TfEfSFVvJhALfjBBDAr4LzLiQEhcWFbSWzswvJIOVZPbhwg9CMuOrF0DUeoKwdvfVuWHqYf9rjS+dih59NsvdlU3BZ2WoDk2Y8tlgxSYHcNsxqhplQokNy+8e6T6hyc= 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=gyMXbrVL; arc=none smtp.client-ip=209.85.222.177 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="gyMXbrVL" Received: by mail-qk1-f177.google.com with SMTP id af79cd13be357-84ab207c37cso75522585a.2 for ; Thu, 25 Sep 2025 06:55:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758808530; x=1759413330; 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=ovaMuoVhmWcLonjnTl4MFtKaHR9pluhUoUKBZs6ASUY=; b=gyMXbrVLp101h/tQHbeWqrn9fQ3voncTf+fRhGlhOrd8SqhLi2ljfdqXUG0/MO0IQe s1m5AzsWY7rreX5eh4Oi8zLFAFNpdwprKWu6quAe+RE9qoH1ouf/hV//HrU2k0J9i+Yg V6G65nlSuRBEfJBQ/5Y3vkd6/lrvWyu5CoTLeL2g/OsQ/CLlQyMnAYVrWFY0L+/W1xOW 0yt+XVJ3rnN2O8YlLnQM2WMnGZhYbP+6LbwPN6zia3AHc4GmjSgNKiYHdotRO0Ecpjd3 /QPkpeN1j64pWep+kZJkHdlrdjg2q/Y77RxCg47nUbl53ihGUJ6QBg1XDQZowveaqrPu ulkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758808530; x=1759413330; 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=ovaMuoVhmWcLonjnTl4MFtKaHR9pluhUoUKBZs6ASUY=; b=IZ2JZmsNFX7cLPD1GfGBMcK1M9ldjed5BWcZOdby16bjttFRn1AM1WXFtIqEFVMZNF XpIzD3dweomAzh31bXaPkCyScewjD91eYpH6xLbC4RCrAtyHaoq8a1MOL+bF71E3vn/R ljMS2e7+64vfmoSFFw5I0+WybjeBDq82kpRCKTNao0vEYaUQK95ovIZ+Be7qyGDJUkVS Tct+NpNC5P4jYSG7w6avDuQHHv75Fjk2rgIqaQPwS2nU28u7q4D0M/X5qNTGofmJa8Hm G7r21zKjB+2l9ADUKdwdWab/4rqy8vLkf+aZur1BkPlKzBzwp1DmDd41yXTgUPhKrm4G bBrw== X-Forwarded-Encrypted: i=1; AJvYcCXPJJ+hPJ9PqQmRxALVyzzBJ4/FEra/nC5sEtuLUquzEM5qBTh3ROntF6mKOFcQ8rHrh3lfs0t05eYrasU=@vger.kernel.org X-Gm-Message-State: AOJu0YzPkGuMn4hnL1Jlt1ky/wlmRPcOUH9WmmIpD8QYr/cQT9h27bOf eq340lDjLx1sjfE9vWqTeTf3wiTtuqcdoLQz8r26mjnvVxrhvA50c1C9 X-Gm-Gg: ASbGncv/EEv1l0BQxI0pcGHnJujCEatY5LFytCNhq0dn94IoyN1o8OvhWK1TnT5AInK nX6OU2bQSd6tXy4J51jEPIV72qasfVbHpD/q/hvqaoELHTrw7Q0cXh7TGgMhUuB+J7LA5QXXHN/ 6mesuJw6I/YxUD4+06N9AFLnW+Ihh3d36Ed89JiMtOVOyX+6WBckfg+qdym2nim9TPKFfVdTYyq jzn4w2IOI6fmzT4IfXGpL95DIK+JyEi4poG3ZUNp0374Zh2Tajq+rXcv5jedTONtxBVGSrEPqww 24Zo5DpXgwEts6ZyeW8Yp4edhmna6pGjwTMRFMtSPGjEGS0eTiyepbgWVwglZGvp/dTGeJqlcHD b7eN6LH54RJI4QnWjBjN+vsj86RuotSVtXiqg/1eSFyPOVs7JqIbAdTOmhC0pG0LNHp+zawhUS+ 9lmC14Jho8YIkCnQn2l/vBMvSpr1yRkqyZp8ahyN69698iR0VZLb4bxMe0cwy5SeOuo0UM X-Google-Smtp-Source: AGHT+IHcH/Zjn6brKl+FzN0cM+iQubEhxUKmnAUgz27UdizV+uwHwEDx4WTup8nJvc6pXzFU23iTKQ== X-Received: by 2002:ad4:5dca:0:b0:792:50bd:2fa8 with SMTP id 6a1803df08f44-7fc30ae34e5mr50026206d6.30.1758808529557; Thu, 25 Sep 2025 06:55:29 -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.55.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Sep 2025 06:55:28 -0700 (PDT) From: Tamir Duberstein Date: Thu, 25 Sep 2025 09:54:00 -0400 Subject: [PATCH v2 12/19] rust: net: replace `kernel::c_str!` with C-Strings 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 Message-Id: <20250925-core-cstr-cstrings-v2-12-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=1758808438; l=1712; i=tamird@gmail.com; h=from:subject:message-id; bh=D/F3RUnYNMNKrZc7ezIrEwfyGQmWHVwyjceS6shQSWA=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgtYz36g7iDMSkY5K7Ab51ksGX7hJgs MRt+XVZTrIzMVIAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QLl+bRXWnt5oagOInMjpq0Q6TsOND3CIu30DW9zld+zzKdTSHrUu641mOBVFK+TECUsf9QEq85h /zu5kdzwmPg0= 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 Signed-off-by: Tamir Duberstein --- rust/kernel/net/phy.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rust/kernel/net/phy.rs b/rust/kernel/net/phy.rs index be1027b7961b..9aeb2bd16b58 100644 --- a/rust/kernel/net/phy.rs +++ b/rust/kernel/net/phy.rs @@ -780,7 +780,6 @@ const fn as_int(&self) -> u32 { /// /// ``` /// # mod module_phy_driver_sample { -/// use kernel::c_str; /// use kernel::net::phy::{self, DeviceId}; /// use kernel::prelude::*; /// @@ -799,7 +798,7 @@ const fn as_int(&self) -> u32 { /// /// #[vtable] /// impl phy::Driver for PhySample { -/// const NAME: &'static CStr =3D c_str!("PhySample"); +/// const NAME: &'static CStr =3D c"PhySample"; /// const PHY_DEVICE_ID: phy::DeviceId =3D phy::DeviceId::new_with_exa= ct_mask(0x00000001); /// } /// # } @@ -808,7 +807,6 @@ const fn as_int(&self) -> u32 { /// This expands to the following code: /// /// ```ignore -/// use kernel::c_str; /// use kernel::net::phy::{self, DeviceId}; /// use kernel::prelude::*; /// @@ -828,7 +826,7 @@ const fn as_int(&self) -> u32 { /// /// #[vtable] /// impl phy::Driver for PhySample { -/// const NAME: &'static CStr =3D c_str!("PhySample"); +/// const NAME: &'static CStr =3D c"PhySample"; /// const PHY_DEVICE_ID: phy::DeviceId =3D phy::DeviceId::new_with_exa= ct_mask(0x00000001); /// } /// --=20 2.51.0