Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp2606009rwp; Fri, 14 Jul 2023 08:32:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlEWN69e0CtKQ5PKkD6q9h00KZkO7ckAKcxjkZBi5mNthsmaVZxQYOy+NpdmAzFVYqX5FlD+ X-Received: by 2002:a17:902:7c0d:b0:1b8:2dca:fa19 with SMTP id x13-20020a1709027c0d00b001b82dcafa19mr3330655pll.28.1689348771817; Fri, 14 Jul 2023 08:32:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689348771; cv=none; d=google.com; s=arc-20160816; b=rCyHNhsxSwVEK62tHznaR1hQGpFQO6jJFGx/5bfSDOmi0kRwxQoAkFcwyfcDA7DHhK MjA/xM9FrVkeyo3PVFJqzhNjqWRqg3T4k7sVw3SqY9Zh6djmjXKW19zdwpoSGSnhBtBC nFYESQgyY5BKOjP6YaH2JCp4p/Ln8LfzI/3umgJQlQqn4l+jJxk4M4K0UX5KOeXrWVl9 liCM8VTeF9ZXpNH/7UQ/DRuJP926G0++J8HIlJMk1V0PyjWd3E1hcvGJq/WnvSc+DS9M SZCwFXmqNooS09s7Wao1S0qS0N1X7FrdlMicMaJr86ptTcrBA2ONxxN3fYYzVQMbPVOO 5hQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=WZZ9EOh8YDl35VB0YBYDo9hjgSAIvlerdtM+lWHSm5g=; fh=5h9Nht05kru9I06aZImqDfpr1g38rNfAP8sGVZZ+BJ8=; b=07ZrEgWr7owOaVOMFuf+ofbj5+OJpw/suCKmhles6dL/Fv26NeFixAVLn8V++Y3sTO 0bTKiLDZowSqBY05ooOhwWUE1wz1ZlwRA3DjhKGWfhazZv1IzOzlWTily4vqCLz6ALp4 /PQF0HqfN44OspBEPkVMplwdLne51o4jccP/qogebfLIdi+FJmqYj6f4XauwLQFfF13N +SRpZRd70KFZjm+anpsiAU8116slEeV4R6l5GiuZyhAygdOg2L2QZBhsT2L2IuXtvnW1 2qm2IbCtYT2AuWONHurxwIbtimq4uEW6diOaFYEoo2tUB81X3hP084uXr3JWUOgBNNio XNag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=JTzzYDbI; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h13-20020a170902680d00b001b9fef6bf58si1489682plk.294.2023.07.14.08.32.39; Fri, 14 Jul 2023 08:32:51 -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=@gmail.com header.s=20221208 header.b=JTzzYDbI; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236170AbjGNPC1 (ORCPT + 99 others); Fri, 14 Jul 2023 11:02:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236281AbjGNPC0 (ORCPT ); Fri, 14 Jul 2023 11:02:26 -0400 Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E80F3AB1; Fri, 14 Jul 2023 08:02:06 -0700 (PDT) Received: by mail-yb1-xb33.google.com with SMTP id 3f1490d57ef6-c7a5600d04dso1932730276.3; Fri, 14 Jul 2023 08:02:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689346925; x=1691938925; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=WZZ9EOh8YDl35VB0YBYDo9hjgSAIvlerdtM+lWHSm5g=; b=JTzzYDbIAeBHNT3Mk2cmNycCC3b97HGw6Wa6P0kp0mxr2C0KJFDPLSxJq8Pd6EzUUh bIjQvzVXcsD1bkZFQ3umgFq9TqY3tY8Vprh3ciL/qkwidOnt0es1ZnABBhViELmcW8yE 7hdoifxju13ojhAoxCW+wwfWHB4F/2wrVUxW2PJQxG+IMSqKaI+ydKOWklkKQA4Wto5C rogJtvx1NQYCG44jC1GrVj0i//rc8q1aYevxx9mKh/QMzrQE31PClFfhAFpn5qJoA6/B PFHvMyG72+PLz7aLqg3R3/vCyN/mdmHx0ftxLv9lQP4Bawm7+5d8f4tAFt0fKL0pnrXL xAwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689346925; x=1691938925; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WZZ9EOh8YDl35VB0YBYDo9hjgSAIvlerdtM+lWHSm5g=; b=PxMj2tMt/UKeITmp5r8EnLseSb+7IYXMhiRmeRfDW0actOv8WF30os3MmwCSyZeIv3 fFQyetMZ+tNYWD+v/AGnq0CEgBpQ7cRGMFhuLOt126IOhX9TP1rN/sH4eD07W5IoGR9y e1MVGd44f70IgqQsXRXniyjnpuZ3XFKMRxGvnl0S1z4LDRsDgeVqjTeabfvmkemN/jel 3bJ4UAoSZRzH3nvPtAKxxZ6CrZZDouyKGB6if/4Rx/qOzqoBCSYGsTyFJxdQIjxns6a+ 1npIPfO0oj8LjfXzrW3N+CNIXsgtdaMs3qFiHF9J6jQPPUy/Nsvm4LBA4ndpSr0i6+Ya FCQw== X-Gm-Message-State: ABy/qLa08wVdTttKyRLBSHOVuVcX+KRANvU2t/o/OWEcCLK6SbHV6NV2 diMDIzhiYzDp/Lv8ZKgRewN+7/kXZft643SQfLE= X-Received: by 2002:a25:c0c8:0:b0:c4f:43d7:7daf with SMTP id c191-20020a25c0c8000000b00c4f43d77dafmr4055869ybf.1.1689346925288; Fri, 14 Jul 2023 08:02:05 -0700 (PDT) MIME-Version: 1.0 References: <20230714140201.383439-1-aliceryhl@google.com> In-Reply-To: <20230714140201.383439-1-aliceryhl@google.com> From: Miguel Ojeda Date: Fri, 14 Jul 2023 17:01:53 +0200 Message-ID: Subject: Re: [PATCH] rust: kernel: str: Implement Debug for CString To: Alice Ryhl Cc: ariel.miculas@gmail.com, alex.gaynor@gmail.com, asahi@lists.linux.dev, benno.lossin@proton.me, bjorn3_gh@protonmail.com, boqun.feng@gmail.com, gary@garyguo.net, lina@asahilina.net, linux-kernel@vger.kernel.org, ojeda@kernel.org, rust-for-linux@vger.kernel.org, wedsonaf@gmail.com 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,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Fri, Jul 14, 2023 at 4:02=E2=80=AFPM Alice Ryhl w= rote: > > Adding some sort of motivation usually works quite well, e.g.: > > Make it possible to use a CString with the `pr_*` macros directly, that > is, instead of > > pr_debug!("trying to open {:?}\n", &*filename); > > we can now write > > pr_debug!("trying to open {:?}\n", filename); Indeed, this would be the most important bit, i.e. answering the "why?". The "what?" and the "how?" are pretty much explained by the title, but it is also fine giving more details (but if the implementation requires an explanation, then it is usually best to write an actual source code comment instead). Cheers, Miguel