[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250619.141817.2042938522863410452.fujita.tomonori@gmail.com>
Date: Thu, 19 Jun 2025 14:18:17 +0900 (JST)
From: FUJITA Tomonori <fujita.tomonori@...il.com>
To: tamird@...il.com
Cc: masahiroy@...nel.org, nathan@...nel.org, ojeda@...nel.org,
alex.gaynor@...il.com, boqun.feng@...il.com, gary@...yguo.net,
bjorn3_gh@...tonmail.com, a.hindborg@...nel.org, aliceryhl@...gle.com,
tmgross@...ch.edu, dakr@...nel.org, gregkh@...uxfoundation.org,
rafael@...nel.org, brendan.higgins@...ux.dev, davidgow@...gle.com,
rmoar@...gle.com, bhelgaas@...gle.com, mcgrof@...nel.org,
russ.weight@...ux.dev, robh@...nel.org, saravanak@...gle.com,
abdiel.janulgue@...il.com, daniel.almeida@...labora.com,
robin.murphy@....com, maarten.lankhorst@...ux.intel.com,
mripard@...nel.org, tzimmermann@...e.de, airlied@...il.com,
simona@...ll.ch, fujita.tomonori@...il.com, nicolas.schier@...ux.dev,
frederic@...nel.org, lyude@...hat.com, tglx@...utronix.de,
anna-maria@...utronix.de, lossin@...nel.org, kwilczynski@...nel.org,
jstultz@...gle.com, sboyd@...nel.org, lorenzo.stoakes@...cle.com,
Liam.Howlett@...cle.com, leitao@...ian.org, viresh.kumar@...aro.org,
linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
rust-for-linux@...r.kernel.org, linux-kselftest@...r.kernel.org,
kunit-dev@...glegroups.com, linux-pci@...r.kernel.org,
linux-block@...r.kernel.org, devicetree@...r.kernel.org,
dri-devel@...ts.freedesktop.org, netdev@...r.kernel.org,
linux-mm@...ck.org, linux-pm@...r.kernel.org, nouveau@...ts.freedesktop.org
Subject: Re: [PATCH v12 5/6] rust: enable `clippy::cast_lossless` lint
On Sun, 15 Jun 2025 16:55:09 -0400
Tamir Duberstein <tamird@...il.com> wrote:
> Before Rust 1.29.0, Clippy introduced the `cast_lossless` lint [1]:
>
>> Rust’s `as` keyword will perform many kinds of conversions, including
>> silently lossy conversions. Conversion functions such as `i32::from`
>> will only perform lossless conversions. Using the conversion functions
>> prevents conversions from becoming silently lossy if the input types
>> ever change, and makes it clear for people reading the code that the
>> conversion is lossless.
>
> While this doesn't eliminate unchecked `as` conversions, it makes such
> conversions easier to scrutinize. It also has the slight benefit of
> removing a degree of freedom on which to bikeshed. Thus apply the
> changes and enable the lint -- no functional change intended.
>
> Link: https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless [1]
> Suggested-by: Benno Lossin <benno.lossin@...ton.me>
> Link: https://lore.kernel.org/all/D8ORTXSUTKGL.1KOJAGBM8F8TN@proton.me/
> Reviewed-by: Benno Lossin <benno.lossin@...ton.me>
> Reviewed-by: Boqun Feng <boqun.feng@...il.com>
> Signed-off-by: Tamir Duberstein <tamird@...il.com>
> ---
> Makefile | 1 +
> drivers/gpu/drm/drm_panic_qr.rs | 4 ++--
> drivers/gpu/nova-core/regs.rs | 2 +-
> drivers/gpu/nova-core/regs/macros.rs | 2 +-
> rust/bindings/lib.rs | 1 +
> rust/kernel/net/phy.rs | 4 ++--
> rust/uapi/lib.rs | 1 +
> 7 files changed, 9 insertions(+), 6 deletions(-)
For PHY part:
Acked-by: FUJITA Tomonori <fujita.tomonori@...il.com>
Powered by blists - more mailing lists