[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiq72nf86+OcMTNPQVnF=pXuaJVw0bFixMxs6qwS5vTh7RWxw@mail.gmail.com>
Date: Tue, 29 Apr 2025 21:05:21 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Danilo Krummrich <dakr@...nel.org>
Cc: Miguel Ojeda <ojeda@...nel.org>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...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>, rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org, patches@...ts.linux.dev
Subject: Re: [PATCH] rust: device: allow `dead_code` for `Device<>::parent()`
On Tue, Apr 29, 2025 at 8:15 PM Danilo Krummrich <dakr@...nel.org> wrote:
>
> Maybe there is a much better solution I don't know about.
There is `cfg_attr` for that, and we use it in a couple places, e.g.
#[cfg_attr(not(CONFIG_AUXILIARY_BUS), expect(dead_code))]
But unless we are more or less sure the condition will only ever
depend on a single `cfg` or so, I am not sure if it is worth the
complexity (and even then reasonable people could disagree).
I wrote about that approach in the "Conditional compilation" in one of
the bullets of:
https://docs.kernel.org/rust/coding-guidelines.html#lints
I hope that helps!
Cheers,
Miguel
Powered by blists - more mailing lists