Skip to content

Commit 06b919e

Browse files
Witcher01ojeda
authored andcommitted
drm/panic: allow verbose version check
Clippy warns about a reimplementation of `RangeInclusive::contains`: error: manual `!RangeInclusive::contains` implementation --> drivers/gpu/drm/drm_panic_qr.rs:986:8 | 986 | if version < 1 || version > 40 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(1..=40).contains(&version)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains = note: `-D clippy::manual-range-contains` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::manual_range_contains)]` Ignore this and keep the current implementation as that makes it easier to read. Fixes: cb5164a ("drm/panic: Add a QR code panic screen") Reported-by: Miguel Ojeda <ojeda@kernel.org> Link: #1123 Signed-off-by: Thomas Böhler <witcher@wiredspace.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://lore.kernel.org/r/20241019084048.22336-8-witcher@wiredspace.de Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent 27aef8a commit 06b919e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/gpu/drm/drm_panic_qr.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,7 @@ pub unsafe extern "C" fn drm_panic_qr_generate(
983983
/// * If `url_len` = 0, only removes 3 bytes for 1 binary segment.
984984
#[no_mangle]
985985
pub extern "C" fn drm_panic_qr_max_data_size(version: u8, url_len: usize) -> usize {
986+
#[expect(clippy::manual_range_contains)]
986987
if version < 1 || version > 40 {
987988
return 0;
988989
}

0 commit comments

Comments
 (0)