[PATCH] drm/panic: clean Clippy warning
Jocelyn Falempe
jfalempe at redhat.com
Mon Mar 3 09:42:10 UTC 2025
On 03/03/2025 10:32, Miguel Ojeda wrote:
> 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.
Thanks, it looks good to me.
Reviewed-by: Jocelyn Falempe <jfalempe at redhat.com>
>
> 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
More information about the dri-devel
mailing list