lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANiq72=62mXHyurwDkqvesVFy0FSW24o7hx=BJvY3X8p+H39Ag@mail.gmail.com>
Date: Sun, 18 Aug 2024 23:32:26 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Miguel Ojeda <ojeda@...nel.org>
Cc: Wedson Almeida Filho <wedsonaf@...il.com>, Alex Gaynor <alex.gaynor@...il.com>, 
	Russell King <linux@...linux.org.uk>, 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@...sung.com>, 
	Alice Ryhl <aliceryhl@...gle.com>, Christian Schrefl <chrisi.schrefl@...il.com>, 
	Jamie Cunliffe <Jamie.Cunliffe@....com>, Sven Van Asbroeck <thesven73@...il.com>, 
	linux-arm-kernel@...ts.infradead.org, rust-for-linux@...r.kernel.org, 
	linux-kernel@...r.kernel.org, patches@...ts.linux.dev
Subject: Re: [PATCH] rust: error: allow `useless_conversion` for 32-bit builds

On Tue, Jul 30, 2024 at 5:57 PM Miguel Ojeda <ojeda@...nel.org> wrote:
>
> For the new Rust support for 32-bit arm [1], Clippy warns:
>
>     error: useless conversion to the same type: `i32`
>        --> rust/kernel/error.rs:139:36
>         |
>     139 |         unsafe { bindings::ERR_PTR(self.0.into()) as *mut _ }
>         |                                    ^^^^^^^^^^^^^ help: consider removing `.into()`: `self.0`
>         |
>         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
>         = note: `-D clippy::useless-conversion` implied by `-D warnings`
>         = help: to override `-D warnings` add `#[allow(clippy::useless_conversion)]`
>
> The `self.0.into()` converts an `c_int` into `ERR_PTR`'s parameter
> which is a `c_long`. Thus, both types are `i32` in 32-bit. Therefore,
> allow it for those architectures.
>
> Link: https://lore.kernel.org/rust-for-linux/2dbd1491-149d-443c-9802-75786a6a3b73@gmail.com/ [1]
> Signed-off-by: Miguel Ojeda <ojeda@...nel.org>

Applied to `rust-next` -- thanks everyone!

    [ Fixed typo in tag. - Miguel ]

We can also change the formatting later on top of the series that will
enable that lint.

Cheers,
Miguel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ