From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 B2F70459AF9; Sun, 11 Oct 2026 14:43:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791729819; cv=none; b=B5LkP1OM83XH6F+7aZzLxHy3HORTsHWCwqcyoDZFmKqpJu+ZwGvqJFmNR2+afNJ3Q/OoJskVTxXeUUQ0piphgK9PGzZ00MsHUsZ8D9eUL7IN8BtpaTgwQy/Sm6I/P6pOwwz5Jbbuv0VIKzzt+XMRL3oFTh3hAOc4dr9RYqywQbg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791729819; c=relaxed/simple; bh=FWhS1GSbio4NmB9mGUNLM0ZeY2dHVo2pwRnkMJ0VTUM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DtkNmYGv3IFA41COAPefIjI4O6Xowo5sauRCZOHD81M0+B+tiaQNe/diCBLn/9XAG46/LdZAB83B4f8Pluqt7tF9NUvgvwWm2g6itwdFQvvQDVpYbIGrckukkd7aYgkhow/7qXiiMFAdcH9IQjdsq2gItk+aQG0v/IFtgTQTiu8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=tRnQVSnk; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="tRnQVSnk" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1791729815; bh=FWhS1GSbio4NmB9mGUNLM0ZeY2dHVo2pwRnkMJ0VTUM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tRnQVSnk7FVLxK7jtlFVL7ogFoBS5QsNFfqcelpy4fLLjaoJRIcd2aSAQtc/uCnfA lfErRvuSm1vsOfzKJVyM/D9lwrA23RfHHmfscdTlaI7RtOvpacS9lmOpb42A0vZKsd wnrzvkqHY3CVOvEVdQBqXezYUXg7ltd7jNNSwRWM= Date: Sun, 11 Oct 2026 16:43:34 +0200 From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Gary Guo Cc: Jason Baron , Jim Cromie , Miguel Ojeda , Boqun Feng , =?utf-8?B?QmrDtnJu?= Roy Baron , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Daniel Almeida , Tamir Duberstein , Alexandre Courbot , Onur =?utf-8?B?w5Z6a2Fu?= , Andrew Morton , Will Deacon , Peter Zijlstra , Mark Rutland , Lyude Paul , Yury Norov , Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin , Brendan Higgins , David Gow , Rae Moar , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-modules@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, driver-core@lists.linux.dev Subject: Re: [PATCH RFC 01/11] rust: print: use CStr for __LOG_PREFIX Message-ID: References: <20261011-rust-dyndbg-v1-0-832e4039b71f@weissschuh.net> <20261011-rust-dyndbg-v1-1-832e4039b71f@weissschuh.net> 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On 2026-10-11 14:01:45+0100, Gary Guo wrote: > On Sun Oct 11, 2026 at 1:52 PM BST, Thomas Weißschuh wrote: > > The users of __LOG_PREFIX require that it is 0-terminated. > > Currently this requirement is only encoded in safety comments. > > > > Switch to CStr which can guarantee this invariant through the type > > system. > > > > As __LOG_PREFIX and Module::NAME are now identical, reuse the former to > > implement the latter. > > > > Signed-off-by: Thomas Weißschuh > > See > https://lore.kernel.org/rust-for-linux/20260728-printk-v1-2-855606634d70@garyguo.net/. Thanks. I'll use that instead. > Best, > Gary > > > --- > > rust/kernel/lib.rs | 4 ++-- > > rust/kernel/print.rs | 11 ++++------- > > rust/macros/module.rs | 4 ++-- > > scripts/rustdoc_test_gen.rs | 4 ++-- > > 4 files changed, 10 insertions(+), 13 deletions(-) >