From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) (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 0AFF1279789 for ; Wed, 28 May 2025 10:36:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748428597; cv=none; b=THKQ766GzP8YG/3YlnJenEpHZYobIuy7oUsrtKez3lbgujqmG0sWmNH3SJKLyeHUYtTI6XsfF+j5gTBraz3cnqKxfZuc+mXVdR9043gYAnANG006AVwdCgx/TQd2GGuHRQih79b5QNFE3YQ0E9DhavFz4VgbvQUgqSYmEVAMD6U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748428597; c=relaxed/simple; bh=Si1j6uouuZRKixZgcv6BHoJXWodMnlY2oC/q9yWhRtM=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=pC533zs9iHDHy+6qD5Ypj7cc6TkAQgLCEnQfeG/cwx3N/cI0KO5xQlLzD7Ko+khM6GkNecx2e02q129/MXyCi0vLJDC3wwWtGSXHktBX2UeE/TFZZkLCX4Wo+VzMOFyzLuccZ07+sExCr06A8yKLXJu6Ra4Rut2KDXwzHyHorf8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=B5eSM2ys; arc=none smtp.client-ip=209.85.128.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="B5eSM2ys" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-442ffaa7dbeso32999855e9.3 for ; Wed, 28 May 2025 03:36:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1748428594; x=1749033394; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=Si1j6uouuZRKixZgcv6BHoJXWodMnlY2oC/q9yWhRtM=; b=B5eSM2ys+lzU9jsSKW8f2NVwNe8eM8+bJ9Ksg0qLUykjwmdFPweLQsA2/kF+LfbdR8 EsIc+idddvAhVYGr1+sUwYD72Xxq4Phgts9qUcpqLWH+zBunCLT3mtJRvorYWaH269ia 76WYrmuuTpaSXQ8kuLwNcE2+uzJ/VTMxs1CwpmHEICrvEzUCg77IGhCE9EiXGSZf7oO6 cdUa6gukkH8IQC4asmvi9L4vk+ZfJZwyoAAApzCpjJjmSJxvcZjnKFqxENnZ6YR8a/4u CwEEY+jVnVwEYzBGXymd/EtIjY0b5Fek0EzcpNvaUSIVlrGx5DPowZVn1EwrZkjzaW1r Tgbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748428594; x=1749033394; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=Si1j6uouuZRKixZgcv6BHoJXWodMnlY2oC/q9yWhRtM=; b=qysxers0+vlwKaUewN6p7oXgaeUIFO1GzmOGEocoqtnR/i9SKVq6DAIWbx6w9WZ2nV ghJiZEO0fJ9c+S4q75Z40xTd4gE1L1L16rOzbvWObZ3CiDTNN6Y8rmP9lhgKuhq4UPZT vELM1BQy7ViSR8JauE+1HWzpPkzxThU/F7YWLk95dbME38+6S9JCRVDMRIcqI94d5v+p IP3cDQhyfGtsUPf3HN9CsbphAQ9tnOPlEYLs9gJw9cq1vXLuk9y1ES/UBaLec0VWpAL3 nHzBbdpo28Go8LLZ486rP6DBDU3QpzLbEQROuQSykSoP/paE8zzEjBBStlj1k8+9c4Ct 4aLQ== X-Forwarded-Encrypted: i=1; AJvYcCWOMqt/LbJh/rug8USH4ezQiuaRNjWIHwxJGUg7pfbSgItS7swX88q5Bpj3jzm4RxZJmFrmYaBplQI=@vger.kernel.org X-Gm-Message-State: AOJu0YwEpwaLt2RlZHcJIJ0h2sgYGDip533Eh3Qv07+ntaVaAw9LjZxS BKZqo8VyqWiawtxX9yPkQYBTV9mF0I7h7EYv+K/PYDfBoznnXDdVwOPBazL1Ax/8mwaY1MVYMdG nc3pKSOooD8KB1XbRkg== X-Google-Smtp-Source: AGHT+IHiPY375iu6n+ZkU8ZC6vWYnO6vfkfIsES083JMYvmdbEogAqIJfVfK9XDvKlL1n6CsZmK6dlKKd2C91Us= X-Received: from wmbhc21.prod.google.com ([2002:a05:600c:8715:b0:442:f984:ed5e]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:a13:b0:43d:160:cd9e with SMTP id 5b1f17b1804b1-44c91fbb448mr159783095e9.17.1748428594079; Wed, 28 May 2025 03:36:34 -0700 (PDT) Date: Wed, 28 May 2025 10:36:31 +0000 In-Reply-To: Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250524-cstr-core-v10-0-6412a94d9d75@gmail.com> <20250524-cstr-core-v10-4-6412a94d9d75@gmail.com> Message-ID: Subject: Re: [PATCH v10 4/5] rust: replace `kernel::c_str!` with C-Strings From: Alice Ryhl To: Tamir Duberstein Cc: Benno Lossin , Michal Rostecki , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , "=?utf-8?B?QmrDtnJu?= 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 , "Krzysztof =?utf-8?Q?Wilczy=C5=84ski?=" , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, dri-devel@lists.freedesktop.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, llvm@lists.linux.dev, linux-pci@vger.kernel.org, nouveau@lists.freedesktop.org, linux-block@vger.kernel.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 literal= , > > 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. I like Benno's suggestions, but str_to_cstr! could also work? Alice