[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <32b5e40d-f1a1-4104-b4e4-1471de77e2d8@nvidia.com>
Date: Mon, 28 Apr 2025 13:25:03 -0700
From: John Hubbard <jhubbard@...dia.com>
To: Rob Herring <robh@...nel.org>
Cc: Remo Senekowitsch <remo@...nzli.dev>, Danilo Krummrich <dakr@...nel.org>,
Dirk Behme <dirk.behme@...il.com>, Saravana Kannan <saravanak@...gle.com>,
Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...nel.org>, Alice Ryhl <aliceryhl@...gle.com>,
Trevor Gross <tmgross@...ch.edu>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>, Dirk Behme
<dirk.behme@...bosch.com>, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, rust-for-linux@...r.kernel.org
Subject: Re: [PATCH v3 3/7] rust: property: Introduce PropertyGuard
On 4/28/25 1:18 PM, Rob Herring wrote:
> On Sun, Apr 27, 2025 at 03:12:18PM -0700, John Hubbard wrote:
>> On 4/26/25 2:50 PM, Remo Senekowitsch wrote:
>>> On Sat Apr 26, 2025 at 5:02 PM CEST, Danilo Krummrich wrote:
>>>> On Sat, Apr 26, 2025 at 04:35:07PM +0200, Dirk Behme wrote:
>>>>> On 26.04.25 16:19, Danilo Krummrich wrote:
>>>>>> On Sat, Apr 26, 2025 at 01:08:39PM +0200, Remo Senekowitsch wrote:
>>>>>>> On Sat Apr 26, 2025 at 12:15 PM CEST, Danilo Krummrich wrote:
>> ...
>> The idea is that the lower level you are in the software stack, the
>> more rare printing should be.
>
> If that's a kernel style/requirement, I've never heard that. About the
> only coding style in this area I'm aware of don't print messages on
> kmalloc failure because the core does. It's the same concept here.
>
> When practically every caller is printing a message, it should go in the
If *every* caller, without exception, today and tomorrow, including
callers that expect failure--if all of those require printing a message,
then yes, it's time to print from the lower level routine.
Short of that, you end up with potentially excessive, and definitely
unrequested and/or undesirable printing.
> called function. It's not really different than anything else we do. If
> we have 2 functions commonly called in sequence, we combine them into a
> single helper function.
>
Right. And the rules are similar: the lower level has to be accurately
factored out. Not approximately.
thanks,
--
John Hubbard
Powered by blists - more mailing lists