diff options
| author | Lorenzo Delgado <lnsdev@proton.me> | 2026-09-27 18:11:35 +0000 |
|---|---|---|
| committer | Danilo Krummrich <dakr@kernel.org> | 2026-10-02 00:06:52 +0200 |
| commit | 2581f023a5a67dda50c481b6c53838ee1a1c997e (patch) | |
| tree | 0b7f9f6b9e14b60386428977e00cb1b12be4c9df /include/linux | |
| parent | 036b815d6de0ae9fddf93255c0e013e4f29e741c (diff) | |
| download | linux-next-2581f023a5a67dda50c481b6c53838ee1a1c997e.tar.gz linux-next-2581f023a5a67dda50c481b6c53838ee1a1c997e.zip | |
rust: scatterlist: return u32 from SGEntry::dma_len()
`SGEntry::dma_len()` returns `ResourceSize`, but the length of a DMA
segment is not the size of a resource. The C side stores it as an
`unsigned int` (`dma_length` in `struct scatterlist`), the helper
returns `unsigned int`, and a single segment is bounded by the
device's `max_segment_size`, which is an `unsigned int` as well. The
method only widens the value to `resource_size_t`.
Return `u32`, which is what the binding already produces, and drop the
`.into()` along with its `clippy::useless_conversion` allow.
Tyr widens the length to `u64`, which is now a real conversion on
every architecture, so drop its `useless_conversion` allow too.
nova-core converts it to `usize` through `FromSafeCast`, which already
covers `u32`, so it needs no change.
Suggested-by: Danilo Krummrich <dakr@kernel.org>
Link: https://lore.kernel.org/r/DLNPXJ4WPH4L.2MBUGV1TAESYY@kernel.org
Signed-off-by: Lorenzo Delgado <lnsdev@proton.me>
Link: https://patch.msgid.link/20260927-resource-size-newtype-v4-1-447a08af23fb@proton.me
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
