rust: acpi: remove unneeded cast to clean future Clippy warning
Miguel Ojeda
maintainerPATCH 1/1 rust: acpi: remove unneeded cast to clean future Clippy warning
A future Clippy warning, clippy::as_underscore, is getting enabled in parallel in the rust-next tree:
error: using as _ conversion
--> rust/kernel/acpi.rs:25:9
|
25 | self.0.driver_data as _
| ^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: consider giving the type explicitly: usize
The type is already ulong, which nowadays is always usize, so the cast is unneeded. Thus remove it, which in turn will avoid the warning in the future.
Other abstractions of device tables do not use a cast here either.
---
I noticed this in -next -- please feel free to rebase if preferred.
rust/kernel/acpi.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
rust/kernel/acpi.rs +1 -1
@@ -22,7 +22,7 @@ unsafe impl RawDeviceId for DeviceId {const DRIVER_DATA_OFFSET :usize = core::mem::offset_of!(bindings::acpi_device_id, driver_data);fn index (&self) ->usize { - self.0 .driver_dataas _ + self.0 .driver_data } }
base-commit: f5d3ef25d238901a76fe0277787afa44f7714739 --
2.50.0
Quoted 11 lines · Miguel Ojeda
A future Clippy warning,
clippy::as_underscore, is getting enabled in parallel in the rust-next tree:error: using
as _conversion
-->rust/kernel/acpi.rs:25:9
|
25 | self.0.driver_data as _
| ^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: consider giving the type explicitly:usize
Quoted 7 lines
The type is already
ulong, which nowadays is alwaysusize, so the cast is unneeded. Thus remove it, which in turn will avoid the warning in the future.Other abstractions of device tables do not use a cast here either.
Signed-off-by Miguel Ojeda <[email protected]>
Quoted 12 lines · Miguel Ojeda
A future Clippy warning,
clippy::as_underscore, is getting enabled in parallel in the rust-next tree:error: using
as _conversion
-->rust/kernel/acpi.rs:25:9
|
25 | self.0.driver_data as _
| ^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: consider giving the type explicitly:usize
Quoted 7 lines
The type is already
ulong, which nowadays is alwaysusize, so the cast is unneeded. Thus remove it, which in turn will avoid the warning in the future.Other abstractions of device tables do not use a cast here either.
Signed-off-by Miguel Ojeda <[email protected]>