From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 205DB28373; Mon, 26 May 2025 14:56:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748271404; cv=none; b=F0M46PCbyWZH1EVTpPXuGmv8OyoiQoD46GWkYpjKgiQPq7FQomI290PvoNWWZg6qcv3z/DJDeSb8Eazzj66iJq9ZxPZ/o1Sq+Zr5Of7wUBt9cW/L7Z5tA6qIMrIoIiCgzssuhWhEvwhyq/rw6p7jS/GrOaRYvmaaHF9RSVzRXac= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748271404; c=relaxed/simple; bh=FquHezFUc7DH27pfpWI+rH+kmjgYOsLlioRhkjrQCPs=; h=Mime-Version:Content-Type:Date:Message-Id:To:Cc:Subject:From: References:In-Reply-To; b=eZ+rDGAlPyYpAGcFbCGh/kzVQz7MkJ5SfFpf6pXMJOOrIf3c0+wPd3IeyykE3yxmvr/5hFKRXRcUKws7x4Fdmrtk3JAYyILz6QHLfX7+WEBOZ+02+jS5BnPsQPDk3SATvednedYM2vwG0dBil2RoePhOS48hcInoHnhWMkjFDAA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=I2u6SKz5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="I2u6SKz5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51704C4CEE9; Mon, 26 May 2025 14:56:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1748271403; bh=FquHezFUc7DH27pfpWI+rH+kmjgYOsLlioRhkjrQCPs=; h=Date:To:Cc:Subject:From:References:In-Reply-To:From; b=I2u6SKz5k5kaCxDX4uSlRUIJZbwixl2yhSR3XLFBE1J++2X4FAsCXkSjofc1VlCY7 VBLN0Cl5HvPpWt6CG9iBzCDfaCicBR3fVmTroqdFJGSpPQFkB4XK860J2Jn/XKO6a4 OatOQ6AjrmPficieHssNFE4Oo3mKqgwHkX7Yr/177vz7FGGPCvChV1QslpsSyp8HtW vpT2b5LtdSsWlRdKEPvRqeCaaZLo6wUiyh/IJP1vRFyoZwcfP+/nA1wx3usYofjEez fzu1dW2zgTZTJFsZ/IOYU5QtABXcSKFywKh2XyLJ6wExrlEe3sQIbfsVMMixELYon/ Z0ruliGT49S9g== Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 26 May 2025 16:56:31 +0200 Message-Id: To: "Tamir Duberstein" , "Michal Rostecki" , "Miguel Ojeda" , "Alex Gaynor" , "Boqun Feng" , "Gary Guo" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Andreas Hindborg" , "Alice Ryhl" , "Trevor Gross" , "Brendan Higgins" , "David Gow" , "Rae Moar" , "Danilo Krummrich" , "Maarten Lankhorst" , "Maxime Ripard" , "Thomas Zimmermann" , "David Airlie" , "Simona Vetter" , "Greg Kroah-Hartman" , "Rafael J. Wysocki" , "Luis Chamberlain" , "Russ Weight" , "FUJITA Tomonori" , "Rob Herring" , "Saravana Kannan" , "Peter Zijlstra" , "Ingo Molnar" , "Will Deacon" , "Waiman Long" , "Nathan Chancellor" , "Nick Desaulniers" , "Bill Wendling" , "Justin Stitt" , "Andrew Lunn" , "Heiner Kallweit" , "Russell King" , "David S. Miller" , "Eric Dumazet" , "Jakub Kicinski" , "Paolo Abeni" , "Bjorn Helgaas" , "Arnd Bergmann" , "Jens Axboe" , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= Cc: , , , , , , , , , , Subject: Re: [PATCH v10 3/5] rust: replace `CStr` with `core::ffi::CStr` From: "Benno Lossin" X-Mailer: aerc 0.20.1 References: <20250524-cstr-core-v10-0-6412a94d9d75@gmail.com> <20250524-cstr-core-v10-3-6412a94d9d75@gmail.com> In-Reply-To: <20250524-cstr-core-v10-3-6412a94d9d75@gmail.com> On Sat May 24, 2025 at 10:33 PM CEST, Tamir Duberstein wrote: > `std::ffi::CStr` was moved to `core::ffi::CStr` in Rust 1.64. Replace > `kernel::str::CStr` with `core::ffi::CStr` now that we can. What's this supposed to mean? > C-String literals were added in Rust 1.77. Opportunistically replace > instances of `kernel::c_str!` with C-String literals where other code > changes were already necessary; the rest will be done in a later commit. Similarly this, the message should explain the motivation for the change, the change itself and can include additional information. > > Signed-off-by: Tamir Duberstein > --- > drivers/gpu/drm/drm_panic_qr.rs | 2 +- > rust/kernel/device.rs | 4 +- > rust/kernel/error.rs | 4 +- > rust/kernel/firmware.rs | 11 +- > rust/kernel/kunit.rs | 6 +- > rust/kernel/miscdevice.rs | 2 +- > rust/kernel/net/phy.rs | 2 +- > rust/kernel/of.rs | 2 +- > rust/kernel/prelude.rs | 5 +- > rust/kernel/seq_file.rs | 4 +- > rust/kernel/str.rs | 358 +++++++++-------------------------= ------ > rust/kernel/sync/condvar.rs | 2 +- > rust/kernel/sync/lock.rs | 2 +- > rust/kernel/sync/lock/global.rs | 2 +- > 14 files changed, 112 insertions(+), 294 deletions(-) I'm a bit confused by some of the diffs here, they seem pretty messy, any chance that they can be improved? --- Cheers, Benno