From nobody Thu Oct 2 02:05:51 2025 Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) (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 D38FE2FD1CF for ; Thu, 25 Sep 2025 13:56:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758808570; cv=none; b=tp6StmhnzW5JT8dK24ETX2HU3qmSVUQQrrQLn90kLg+mHwc/XaXv2s1kUO5T7ltKgfXFRe9S5d39eFKaPBKbav8nF9kRAZaAg42kBwGNhWFnG/uuqOxSRNynsrofxSTCKwAr8H9iUs6CXPdnr4DSeU6jSHzrx3NJteXnTUgXfJA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758808570; c=relaxed/simple; bh=cd10vY+LdNFm15kjf9buohLVZDsgfigdMJZaOhvjUZ4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dA5ZhYG6/FLhaGcrzFAtG26aYFQ2TPWMKYUd3FJa3P6x1j1vMoNBflUUA/RL//bzLQ+YchtrB9ab6VxAvibbozL0L0nKCiOCKDLFhyUCp90x3M6DY0K3KfiotJT1uSzuR3uagSrnNXoOyNJiqMWoNSuj/IpitYfpOeTBXlGDFbs= 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=kHFNSybA; arc=none smtp.client-ip=209.85.219.45 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="kHFNSybA" Received: by mail-qv1-f45.google.com with SMTP id 6a1803df08f44-78eba712e89so7111076d6.3 for ; Thu, 25 Sep 2025 06:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758808568; x=1759413368; 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=Sq31dC2vDN2a94utvC/B02Ptv/MXvCOxOItQtZFE3ic=; b=kHFNSybAgLMmKvNMEsbdEliOxzUGNfq9vagPqAa/2P2ouxseJFVuYbQskZ+4fD8YM9 9NIt3mmdbJMC+i3qWvQ08fGJ8MT9hIqSisd4lnXj5EEj6rC0nyJF4/rRHWEqGVdMJ5TL gEoIayc33yVrGOkqeZtXbi0WrcUmsIFnAkJ5nPhsZg4FZWVokLo9MqKqI85+ltSjprJy 5PQRU4ClR3AHlJGgrE4p1TO/3VoLha0O/Nxi6ls+OYPcDCcsvgCCn9ibTvMFoc3nz5wB YfKsEWSRaFBxKQW9z03Jvmyf/Nx9L7D2xx/tZWHSPqvJNdBIGECg11eC0myYQxueOI66 jyQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758808568; x=1759413368; 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=Sq31dC2vDN2a94utvC/B02Ptv/MXvCOxOItQtZFE3ic=; b=HnPW9z8//M3v5lLknWJQhDNWToxPIpRMFu1C5c6S5c4tgorD8LEsh0hJF8R7oHfb0a ud8UGdBp2QT+oN1217iaRnQxR0vHi5viT7or8YuJCFtqVo1tYhOPn/B0bHpM2z1VdNl2 hKx25iwYRxIVDHKz/xsMSExhsPtZhEP4VLp7fWHjnA3qMuJyMcoAl62h2sYKRfNWoA/V X8QNd69JSJbUCST7jQfvSsNzPp2tlbpvZf9VDyExm468vVyV9lfmuEnGsty/sCeuHPFc 5SpJfmXL5F/l9rLWYCclic7o8XD4Pps75cpJ99kU3dneDZrU21cr1XHxSK7hPM/jDcKq 66eA== X-Forwarded-Encrypted: i=1; AJvYcCW7bFZzbL6J+wB/RQqI602+YMaZFKzAWDjdzcmqqkbhO0zo6nh5D5dtm7iCzjjO0fPhyqLiCjDXA1oMydA=@vger.kernel.org X-Gm-Message-State: AOJu0Yzxw74Phe2GXQMnpl0ASBLs3MRla6FMrjwX/yavd0SUho0wcQeY oceWnwa80sQrEdZRBJ/vcVajbpzKQksyS97ueuLyFrdJhuZlXOg18ny7 X-Gm-Gg: ASbGncussGRE1gWkFbmcMvrJ/hFWbEshvtOkFz7N1MeuLjeUKOLwEdKvzxtb1fKQBfp 8LmZY37FI5ZFUlFOSsZTNSK1gfyptG59jNF1UlX63RdiuBYwIAXPQimRdXo5o96Wsj+2Rh9ecty 7bChQowJOtJPV9tBCGncusA+SPiQPLv6x4uaURxTZbpXYycDvKtHbpIqA5tZNPL7KjscMOp5q3o WZyETNUY3T/Inb38yFTSCibtBXD9IxGIQYa357ILqRiEerU8cEuTBRFdy1+SpjnnEWjJuAv351a wsYeGGEyYyRSTOhQ/+9pRxYmNTjF07S+Gux7R1U4FMebKfOHd3RKm4S/GpnmNzfMQ7IDy57f5bP oTWsnaAyKinMseqQo/1BCZTnGOxZMJd15zMrVuGUqTeSkMlD4z+DQ88xrD3gLA9sCav2NaygAqE P5I09oDKEasbSIHsKWld1RiJRkCfLkj1h2n7sF0QTVepIOKB+w/eTJQwC7pOYDrfkhJhxbeL+aA sYuHIA= X-Google-Smtp-Source: AGHT+IEZhM30AGXNdbFILEQiyz/kr05nZm4O0BE8w754iMuzz8n1eM1enRH3Kra7C8BiuYUbQtPrdA== X-Received: by 2002:a05:6214:3014:b0:80e:4f6d:23be with SMTP id 6a1803df08f44-80e4f6d25a9mr15832686d6.62.1758808567133; Thu, 25 Sep 2025 06:56:07 -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.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Sep 2025 06:56:06 -0700 (PDT) From: Tamir Duberstein Date: Thu, 25 Sep 2025 09:54:06 -0400 Subject: [PATCH v2 18/19] rust: io: 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-18-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=1724; i=tamird@gmail.com; h=from:subject:message-id; bh=cd10vY+LdNFm15kjf9buohLVZDsgfigdMJZaOhvjUZ4=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgtYz36g7iDMSkY5K7Ab51ksGX7hJgs MRt+XVZTrIzMVIAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QNf162nJINfyau54ApOtSNUKBNqSEvAN/RUj/VaS1rCjXvJ9mtYy/yqZWgJQlP/HSnYEPjCYYdQ IPwDjgyMc4w4= 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 Acked-by: Danilo Krummrich Reviewed-by: Alice Ryhl Reviewed-by: Benno Lossin --- rust/kernel/io/mem.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/rust/kernel/io/mem.rs b/rust/kernel/io/mem.rs index 6f99510bfc3a..2e42eb906061 100644 --- a/rust/kernel/io/mem.rs +++ b/rust/kernel/io/mem.rs @@ -4,7 +4,6 @@ =20 use core::ops::Deref; =20 -use crate::c_str; use crate::device::Bound; use crate::device::Device; use crate::devres::Devres; @@ -44,7 +43,7 @@ pub(crate) unsafe fn new(device: &'a Device, resou= rce: &'a Resource) -> S /// illustration purposes. /// /// ```no_run - /// use kernel::{bindings, c_str, platform, of, device::Core}; + /// use kernel::{bindings, platform, of, device::Core}; /// struct SampleDriver; /// /// impl platform::Driver for SampleDriver { @@ -102,7 +101,7 @@ pub fn iomap_exclusive_sized( /// illustration purposes. /// /// ```no_run - /// use kernel::{bindings, c_str, platform, of, device::Core}; + /// use kernel::{bindings, platform, of, device::Core}; /// struct SampleDriver; /// /// impl platform::Driver for SampleDriver { @@ -164,7 +163,7 @@ impl ExclusiveIoMem { fn ioremap(resource: &Resource) -> Result { let start =3D resource.start(); let size =3D resource.size(); - let name =3D resource.name().unwrap_or(c_str!("")); + let name =3D resource.name().unwrap_or_default(); =20 let region =3D resource .request_region( --=20 2.51.0