mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 21:39:35 -04:00
rust: drm: fix non-const read8 in unit test
With CONFIG_CC_OPTIMIZE_FOR_SIZE, the address validity check in non-const
`read8` invocaction is not optimized away, leading to build failure.
Fixes: d055768429 ("rust: drm: gem: shmem: Add vmap functions")
Signed-off-by: Gary Guo <gary@garyguo.net>
Link: https://patch.msgid.link/20260716142545.3622278-2-gary@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
This commit is contained in:
committed by
Danilo Krummrich
parent
ce2d97f714
commit
22e77d81d0
@@ -688,7 +688,7 @@ fn vmap_io() -> Result {
|
||||
// Ensure the ordering in memory is correct
|
||||
let expected = 0xFEDCBA98_u32.to_ne_bytes().into_iter();
|
||||
for (offset, expected) in (0x20..=0x23).zip(expected) {
|
||||
assert_eq!(vmap.read8(offset), expected);
|
||||
assert_eq!(vmap.try_read8(offset).unwrap(), expected);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user