[PATCH] drm/panic: clean Clippy warning
Miguel Ojeda
ojeda at kernel.org
Mon Mar 3 09:32:42 UTC 2025
Clippy warns:
error: manual implementation of an assign operation
--> drivers/gpu/drm/drm_panic_qr.rs:418:25
|
418 | self.carry = self.carry % pow;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.carry %= pow`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern
Thus clean it up.
Fixes: dbed4a797e00 ("drm/panic: Better binary encoding in QR code")
Signed-off-by: Miguel Ojeda <ojeda at kernel.org>
---
drivers/gpu/drm/drm_panic_qr.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_panic_qr.rs b/drivers/gpu/drm/drm_panic_qr.rs
index 62cb8a162483..3b0dd59781d4 100644
--- a/drivers/gpu/drm/drm_panic_qr.rs
+++ b/drivers/gpu/drm/drm_panic_qr.rs
@@ -415,7 +415,7 @@ fn next(&mut self) -> Option<Self::Item> {
self.carry_len -= out_len;
let pow = u64::pow(10, self.carry_len as u32);
let out = (self.carry / pow) as u16;
- self.carry = self.carry % pow;
+ self.carry %= pow;
Some((out, NUM_CHARS_BITS[out_len]))
}
}
base-commit: c0eb65494e59d9834af7cbad983629e9017b25a1
--
2.48.1
More information about the dri-devel
mailing list