diff options
| author | Marko Turk <mt@markoturk.info> | 2025-12-10 12:25:51 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-01-02 12:57:05 +0100 |
| commit | 93b3274587e8d747d99c2cb77164a9b2304c0935 (patch) | |
| tree | 7512a2e036a0a19b77f97bf3608929b23b43320b /samples | |
| parent | 48298e1ba378c04876dc8feb8dfc412706403762 (diff) | |
| download | linux-93b3274587e8d747d99c2cb77164a9b2304c0935.tar.gz linux-93b3274587e8d747d99c2cb77164a9b2304c0935.tar.bz2 linux-93b3274587e8d747d99c2cb77164a9b2304c0935.zip | |
samples: rust: fix endianness issue in rust_driver_pci
commit e2f1081ca8f18c146e8f928486deac61eca2b517 upstream.
MMIO backend of PCI Bar always assumes little-endian devices and
will convert to CPU endianness automatically. Remove the u32::from_le
conversion which would cause a bug on big-endian machines.
Cc: stable@vger.kernel.org
Reviewed-by: Dirk Behme <dirk.behme@de.bosch.com>
Signed-off-by: Marko Turk <mt@markoturk.info>
Fixes: 685376d18e9a ("samples: rust: add Rust PCI sample driver")
Link: https://patch.msgid.link/20251210112503.62925-2-mt@markoturk.info
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'samples')
| -rw-r--r-- | samples/rust/rust_driver_pci.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/samples/rust/rust_driver_pci.rs b/samples/rust/rust_driver_pci.rs index 55a683c39ed9..ea3063e558b1 100644 --- a/samples/rust/rust_driver_pci.rs +++ b/samples/rust/rust_driver_pci.rs @@ -48,7 +48,7 @@ impl SampleDriver { // Select the test. bar.write8(index.0, Regs::TEST); - let offset = u32::from_le(bar.read32(Regs::OFFSET)) as usize; + let offset = bar.read32(Regs::OFFSET) as usize; let data = bar.read8(Regs::DATA); // Write `data` to `offset` to increase `count` by one. |
