Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp386397rdf; Fri, 3 Nov 2023 03:59:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEXkCxtSpabu09RvOOHdAg3QI1fmFKFar5JwwI1YidpxykPGAK7aTmmS0K0ebVfnUEi4IeP X-Received: by 2002:a17:902:d4c2:b0:1cc:5aef:f2cf with SMTP id o2-20020a170902d4c200b001cc5aeff2cfmr14217234plg.9.1699009196880; Fri, 03 Nov 2023 03:59:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699009196; cv=none; d=google.com; s=arc-20160816; b=EKYCCUTFTBSk2ENKLPdlojAX0Sf9WxHFOXCrLGd33CEDTosKkS+WttXOCSlV2x15R0 GQ6oh7B8XAV/qQFLSdWkO21Z0klKRR4YkJltNPmDrFrLxpPz0u0psVn/ArPqBr+r24YK psvecSzRgk1cFgwNR7/WoYe6+MaUN9856VQ4+kvSgLUvCvt31Fw+oseRM+lTtJLf8LyM fzZKWKHH0NiWq25/ucwqoW44hWWfQk8sleCQtTYhXfpAhssowsm/lpHXGiiLqBDWJSwn Rk75HUVmq2JMH5YdVZbU1hakjXAwjo5ZNwHeVKlEL4vUqcNzSMzKb94Aoq+DooTRok26 qZQQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :from; bh=v88bXp/Pzz3KupI1R/cU3rgQhWmmooa/JqPJrqKEJAU=; fh=lvtj4fKjxKA9ICRAZvwoCt96fsPVtN+faDDJACNELm4=; b=GV3W/EwD/UI6j9nXEf89MWHckM6e/ZG1Zz5V21QkGjni8/pZNHcKpmwqrHK/r4SnOz NbdU8Zzx+zrNnXXSnPAYEF5ow4S8qoQLHhCTQLRGBHW2cUB3BwTVXiAWwZpSixnjk3GD oc1qBoGVpW4f6dRZEB/vH/UCLfdbPdIVbu0rSmT9KZEzmr0fQSgm1LphfEpFjtRQa6fr C3K0LtMeOS2AD8hgluGI+NbspG0rMM4Jcu/TqkAtHP9wZ6Z+p/jnGamYYbHeMeMzynbA JRXNpmkvyN5UfQ9CBfKFv9v5SUh7n3XK+4AOMXXtJtYXVcQ/zaaCDpTX8y7MicNZWQbu 8dMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kloenk.de header.s=mail header.b=CfMEaSuP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=kloenk.de Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id m5-20020a170902db0500b001ca1bd194b4si1394199plx.416.2023.11.03.03.59.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 03:59:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kloenk.de header.s=mail header.b=CfMEaSuP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=kloenk.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id EE1B283B7B50; Fri, 3 Nov 2023 03:59:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233352AbjKCK7y (ORCPT + 99 others); Fri, 3 Nov 2023 06:59:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229906AbjKCK7x (ORCPT ); Fri, 3 Nov 2023 06:59:53 -0400 X-Greylist: delayed 514 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 03 Nov 2023 03:59:47 PDT Received: from gimli.kloenk.de (gimli.kloenk.de [49.12.72.200]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46AEFCE; Fri, 3 Nov 2023 03:59:47 -0700 (PDT) From: Finn Behrens DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kloenk.de; s=mail; t=1699008669; bh=v88bXp/Pzz3KupI1R/cU3rgQhWmmooa/JqPJrqKEJAU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=CfMEaSuPibdpukZdckDsSViOO18i4SgpcHfb+LJ76DTVOZ7AB/2IuJ3vOiGpZw5gZ 2t19Q0GNtaIoq8X1fmmjUst0COoSGheRgAWi7tHU6xE4isQki/8h/LmR8XT0vydu4O LrlgdIZ+xSGBHp9NGHPy7FZJbr0z7KeK9kgCi6pY= To: Alice Ryhl Cc: Greg Kroah-Hartman , =?utf-8?b?QXJ2ZSBIasO4bm5ldsOlZw==?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Carlos Llamas , Suren Baghdasaryan , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Matt Gilbride , Jeffrey Vander Stoep , Matthew Maurer Subject: Re: [PATCH RFC 03/20] rust_binder: add threading support Date: Fri, 03 Nov 2023 11:51:07 +0100 Message-ID: <62F430CC-9980-4779-9D43-7D561D322C9B@kloenk.de> In-Reply-To: <20231101-rust-binder-v1-3-08ba9197f637@google.com> References: <20231101-rust-binder-v1-0-08ba9197f637@google.com> <20231101-rust-binder-v1-3-08ba9197f637@google.com> 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, SPF_HELO_PASS,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 03 Nov 2023 03:59:56 -0700 (PDT) On 1 Nov 2023, at 19:01, Alice Ryhl wrote: > diff --git a/drivers/android/error.rs b/drivers/android/error.rs > new file mode 100644 > index 000000000000..41fc4347ab55 > --- /dev/null > +++ b/drivers/android/error.rs > + > +impl core::fmt::Debug for BinderError { > + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Resu= lt { > + match self.reply { > + BR_FAILED_REPLY =3D> match self.source.as_ref() { > + Some(source) =3D> f > + .debug_struct("BR_FAILED_REPLY") > + .field("source", source) > + .finish(), > + None =3D> f.pad("BR_FAILED_REPLY"), > + }, > + BR_DEAD_REPLY =3D> f.pad("BR_DEAD_REPLY"), > + BR_TRANSACTION_COMPLETE =3D> f.pad("BR_TRANSACTION_COMPLET= E"), > + _ =3D> f > + .debug_struct("BinderError") > + .field("reply", &self.reply) > + .finish(), > + } > + } > +} Renaming the debug_struct itself feels like it will make it harder to fin= d later, as I would expect that a debug implementation names the struct i= ts from. Also this has the fallback in CamelCase and all defined cases as SCREAMIN= G_SNAKE_CASE. Maybe rather in the defined cases something like f.debug_st= ruct(=E2=80=98BinderError=E2=80=99).field(=E2=80=98reply=E2=80=99, =E2=80= =9Cname=E2=80=9D)?