From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 76E2ACA0EDC for ; Thu, 14 Aug 2025 07:54:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 268BC10E085; Thu, 14 Aug 2025 07:54:21 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="XwG6sxcS"; dkim-atps=neutral Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id 207A810E085; Thu, 14 Aug 2025 07:54:20 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 9EE035C670A; Thu, 14 Aug 2025 07:54:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3FD96C4CEEF; Thu, 14 Aug 2025 07:54:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755158058; bh=8n2URVW1zH35PTkcFhfdDY6JdVB2waPtDBeuhXieSmc=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=XwG6sxcSZ4e7RBPNZDqVWlc3ShcGu5AG24wQYLVS5LuPGPuFBTFuMUCfAU9DlDul3 YqAuR5TsBysOtbQlj172ZmkZPYKd/7ItYBX8xn88aB0G/Z+kY515VurN2zAL9MK+aP 2MG1rFQwZ3KyVb4cEWKd1tWhVQdukyPiHI8Yh3wLIVATqkFlhbQQImhS5e/7yMLNHR g4k8WyYDr386xoOcjRyzRjEC8hppnuQiX2NLbtUlHHCbwZ5ifMdulAfJM2VT+XMC7r c3m+hh/ldIFcj/wcOXssueSZ7r00TCMS+BmzLqghaiMWPzbkWNstIT4NASnh2yY2Pt VKLxy8v3XucDg== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 14 Aug 2025 09:54:10 +0200 Message-Id: Cc: , , , , , , , Subject: Re: [PATCH v3 9/9] rust: device: use `kernel::{fmt,prelude::fmt!}` From: "Benno Lossin" To: "Tamir Duberstein" , "Danilo Krummrich" , "David Airlie" , "Simona Vetter" , "Miguel Ojeda" , "Alex Gaynor" , "Boqun Feng" , "Gary Guo" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Andreas Hindborg" , "Alice Ryhl" , "Trevor Gross" , "Jens Axboe" , "Greg Kroah-Hartman" , "Rafael J. Wysocki" , "Brendan Higgins" , "David Gow" , "Rae Moar" , "Lorenzo Stoakes" , "Vlastimil Babka" , "Liam R. Howlett" , "Uladzislau Rezki" , "Alexandre Courbot" , "Alexander Viro" , "Christian Brauner" , "Jan Kara" X-Mailer: aerc 0.20.1 References: <20250813-core-cstr-fanout-1-v3-0-a15eca059c51@gmail.com> <20250813-core-cstr-fanout-1-v3-9-a15eca059c51@gmail.com> In-Reply-To: <20250813-core-cstr-fanout-1-v3-9-a15eca059c51@gmail.com> X-BeenThere: nouveau@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Nouveau development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" On Wed Aug 13, 2025 at 5:39 PM CEST, Tamir Duberstein wrote: > Reduce coupling to implementation details of the formatting machinery by > avoiding direct use for `core`'s formatting traits and macros. > > Signed-off-by: Tamir Duberstein Reviewed-by: Benno Lossin > --- > rust/kernel/device/property.rs | 23 ++++++++++++----------- > 1 file changed, 12 insertions(+), 11 deletions(-) =20 > @@ -413,9 +414,9 @@ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> co= re::fmt::Result { > // SAFETY: `fwnode_get_name_prefix` returns null or a > // valid C string. > let prefix =3D unsafe { CStr::from_char_ptr(prefix) }; > - write!(f, "{prefix}")?; > + fmt::Display::fmt(prefix, f)?; > } > - write!(f, "{}", fwnode.display_name())?; So we're not able to use `write!` with our `Display` or did you also write a `FmtAdapter` wrapper for that? (don't think we need it now, just wanted to know if we have this issue possibly in the future) --- Cheers, Benno > + fmt::Display::fmt(&fwnode.display_name(), f)?; > } > =20 > Ok(())