diff options
author | Miguel Ojeda <[email protected]> | 2024-07-30 17:57:02 +0200 |
---|---|---|
committer | Miguel Ojeda <[email protected]> | 2024-08-18 23:10:53 +0200 |
commit | 7bc186731e87482662c4f86da455f435fe838fb6 (patch) | |
tree | 893eed6d0a2aa1aa0e967c34bc5c7573a366090c /rust/helpers | |
parent | 7adcdd572248591c3932e27d98b4a086662d5cbe (diff) |
rust: error: allow `useless_conversion` for 32-bit builds
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/[email protected]/ [1]
Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Christian Schrefl <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Fixed typo in tag. - Miguel ]
Signed-off-by: Miguel Ojeda <[email protected]>
Diffstat (limited to 'rust/helpers')
0 files changed, 0 insertions, 0 deletions