Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp3471018rwp; Sat, 15 Jul 2023 03:30:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlHnz9nshhQSB2RFvd9LwIVDI9eGswgs+59DLjVeJI7zYIEOPLUq+Ye/A6bIRWr+vQ7vs54V X-Received: by 2002:a17:902:e549:b0:1b8:a8e5:e8bc with SMTP id n9-20020a170902e54900b001b8a8e5e8bcmr9216237plf.6.1689417021515; Sat, 15 Jul 2023 03:30:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689417021; cv=none; d=google.com; s=arc-20160816; b=AbPgwbFhIni9ZSzIOILwRau/VUOkAlxdf8o1J+0ER4DRzOe5oeJ8NUvT+HsS5W8bUg k1ywyc7D6WqaZmPkQGWaanmCMGc5EOpOlCi/kaWNChEc+A8MYywL/OzowDAY1t//edJp kzSkF+0+BhIelaVk5mB6t2dmD5Ztni/0Bvuv4OLFgWJFuuBy2ME31TxjEZT52FFSMOrp 1K7S8uzCCIriepFBhfM3szD3ASLXSZuwII01uzd5409ApOSPGigseq4ci460aSEVMJDw F91Tna7t4C6CYQkGSt/tx9+pZ13JEZ+vjhzFJTIOTQbM7CuCMb+Rt/rJrHj8RiITasQD O1KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :feedback-id:references:in-reply-to:message-id:subject:cc:from:to :dkim-signature:date; bh=QnF59vl5+yCYRQpMrd2L/uF0PGzIplpwVi1jkdKlyBY=; fh=29oQ08pjeOdvnMMasw4Ui/9AIn+OHx6va2P9estk0Io=; b=RV8aOGZDcp5eoCWJv4XXn+QIqkHlxFx2wlO1tG7OIBs2k7zcwu9opN4yegOaUQ4tXu 4oyTawgq2VW2GCoy9qgw7de1EHKOkym3z7i6bbv02U9n5R0No7tQxOdt/2WxAc1Ub10H LChZckdR1GuF46cXXFb+abZYthmwQfGKoljL6mbb+b7a+5ymSVVsT0dFDD6afWZW/cqi 3zwDIU1g8+lDPrJzTryE7BvbpZ6OTTfRoJONAsDPtAATn/eJHAlvvdwVJ/uxg3ISm1Zu OXFCOMOKKn+4WSqZvZz5HkRHe2osrfu9mAHI2XSt02U2hxa83HnN7G999f9nu0r8Tkxe XQ9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@proton.me header.s=protonmail header.b=Q6UkrPgL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l10-20020a170903120a00b001b041591a5fsi8971401plh.459.2023.07.15.03.30.08; Sat, 15 Jul 2023 03:30:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@proton.me header.s=protonmail header.b=Q6UkrPgL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230328AbjGOKAs (ORCPT + 99 others); Sat, 15 Jul 2023 06:00:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230359AbjGOKAr (ORCPT ); Sat, 15 Jul 2023 06:00:47 -0400 Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFECB2701 for ; Sat, 15 Jul 2023 03:00:45 -0700 (PDT) Date: Sat, 15 Jul 2023 10:00:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1689415244; x=1689674444; bh=QnF59vl5+yCYRQpMrd2L/uF0PGzIplpwVi1jkdKlyBY=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=Q6UkrPgLIIJU7b8/F8r0FqjyX9koF7x8ThbaXuvrSa7L4b74Qox63R8l+kmRz1f/j 9+yOUhlEaqz4mkzyHnHVStt4Sakh07G3jaOIJ4FnNQRb5pLXdP8Wx2J6+CUnN5r8Xv b1dvJYa0D1OWk7CmYnMXJUI1fbT6naJlSsTB2PJwNM9fSgTu+WOTyKHri8Huy2XAUy L3becJS07dyXOF1lBcc2o1lDqFn1yTKJAuRN+ckEe5jI1X+EnRFl34xSGBB+rqRDLv VH0lNDVEwwau/55u820bNeTME6csSA4DBU+wjnc9/LZj0C7WPIjEq6CxqW64iE9Pn3 sIVvdspHn0G3g== To: Asahi Lina From: Benno Lossin Cc: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?Q?Bj=C3=B6rn_Roy_Baron?= , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, asahi@lists.linux.dev Subject: Re: [PATCH] rust: kernel: str: Implement Debug for CString Message-ID: In-Reply-To: <20230714-cstring-debug-v1-1-4e7c3018dd4f@asahilina.net> References: <20230714-cstring-debug-v1-1-4e7c3018dd4f@asahilina.net> Feedback-ID: 71780778:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14.07.23 11:19, Asahi Lina wrote: > Trivial implementation. >=20 > Signed-off-by: Asahi Lina With a better commit message you can add Reviewed-by: Benno Lossin --=20 Cheers, Benno > --- > rust/kernel/str.rs | 6 ++++++ > 1 file changed, 6 insertions(+) >=20 > diff --git a/rust/kernel/str.rs b/rust/kernel/str.rs > index c9dd3bf59e34..a94e396d39e1 100644 > --- a/rust/kernel/str.rs > +++ b/rust/kernel/str.rs > @@ -606,6 +606,12 @@ fn try_from(cstr: &'a CStr) -> Result { > } > } >=20 > +impl fmt::Debug for CString { > + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { > + fmt::Debug::fmt(&**self, f) > + } > +} > + > /// A convenience alias for [`core::format_args`]. > #[macro_export] > macro_rules! fmt { >=20 > --- > base-commit: 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5 > change-id: 20230714-cstring-debug-ca021fe0ad78 >=20 > Thank you, > ~~ Lina >