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 1BFCEC5AD49 for ; Wed, 28 May 2025 15:35:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7341F10E624; Wed, 28 May 2025 15:35:09 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="kVPnqshC"; dkim-atps=neutral Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id EC89510E624; Wed, 28 May 2025 15:35:08 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 2127E43F04; Wed, 28 May 2025 15:35:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B031C4CEE3; Wed, 28 May 2025 15:34:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1748446506; bh=zB7eSGVJ68Jl0gMC9+d7mPya9pfNddYzQqEMb7NDisM=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=kVPnqshCxEe5Da+hatugp5jpRO+YqdxnSK8hHV9/MuHaeYogJc8HUNfD+v7Y7oNnd ajTOOvKZaF0AWykZCZmwO7rAa8WJYeT6DIdhhnZOGCLAyadkSOftnheVVRR4FwmZLb wINaZlL/et1WxglyVXp6Bdc2km89Q4hZ8nTMOxo7LZNYnc6ZSms6wti8wzmuvtyWSz Ytq92scLm0QqesXBybdXA+fa1nRyGQudkluYwUXFNmEW9Vvt+RNGG7P+2+BjFDmGjt 0jtso4IYLC52ByJ/P3KhBshux6a8WckGKiCjTxpDWhMHWsCdgKZeCnAhtK1FWUAVGf 4ZiszX0mmUL+w== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 28 May 2025 17:34:53 +0200 Message-Id: Subject: Re: [PATCH v10 4/5] rust: replace `kernel::c_str!` with C-Strings From: "Benno Lossin" To: "Alice Ryhl" , "Tamir Duberstein" Cc: "Michal Rostecki" , "Miguel Ojeda" , "Alex Gaynor" , "Boqun Feng" , "Gary Guo" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Andreas Hindborg" , "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?= , , , , , , , , , , , X-Mailer: aerc 0.20.1 References: <20250524-cstr-core-v10-0-6412a94d9d75@gmail.com> <20250524-cstr-core-v10-4-6412a94d9d75@gmail.com> In-Reply-To: X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Wed May 28, 2025 at 12:36 PM CEST, Alice Ryhl wrote: > On Mon, May 26, 2025 at 06:29:46PM -0400, Tamir Duberstein wrote: >> On Mon, May 26, 2025 at 11:04=E2=80=AFAM Benno Lossin wrote: >> > >> > On Sat May 24, 2025 at 10:33 PM CEST, Tamir Duberstein wrote: >> > > +macro_rules! c_str_avoid_literals { >> > >> > I don't like this name, how about `concat_to_c_str` or >> > `concat_with_nul`? >> > >> > This macro also is useful from macros that have a normal string litera= l, >> > but can't turn it into a `c""` one. >>=20 >> Uh, can you give an example? I'm not attached to the name. > > I also think it should be renamed. Right now it sounds like it creates a > c string while avoiding literals in the input ... whatever that means. Yeah that's a good way to put why the name is weird. > I like Benno's suggestions, but str_to_cstr! could also work? Hmm, I think then people won't know that it can also concat? I don't think it matters too much, the macro probably won't be used that often and if someone needs to use it, they probably wouldn't fine it by name alone. --- Cheers, Benno