From nobody Tue Nov 26 10:45:41 2024 Received: from out-176.mta1.migadu.com (out-176.mta1.migadu.com [95.215.58.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5EDC31DFE10 for ; Sat, 19 Oct 2024 08:41:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729327296; cv=none; b=rf0oKUehUruzIO/GauUKhpiZeCNRtTbqusN2h6AJBe4XMpunMCBrF3aU928w/Tez0uXkDwaRyr1E2BJWQFYodDgO0RNGjTfHaAcyL4diIYQzq2YOsRzQG3l8H5z3pRyVzXahD0nTAyMPNjxLjokS8+7mxlGBTEE7229QcTxGEd0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729327296; c=relaxed/simple; bh=eRkewpVRWn3VOWbswg3ulxg5hPlL0OIkfPL+78ofKZE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=maQvwre/ZlQCatZbertVdWakiX/yDPmWAbmR6VRbGLwmY1fkcr9xdCcRo62vZGW46k58ncItFjbDJrMhSsqiyAHFFFynUAHcETJwnR07htSwRyUy8W7ZSTUsdUWc0IG8eUpcxdWP0980dOLxe5exWH2DnQIRITQYo8U6qxgJpTo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wiredspace.de; spf=pass smtp.mailfrom=wiredspace.de; dkim=pass (1024-bit key) header.d=wiredspace.de header.i=@wiredspace.de header.b=ieXOYAvM; arc=none smtp.client-ip=95.215.58.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wiredspace.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wiredspace.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=wiredspace.de header.i=@wiredspace.de header.b="ieXOYAvM" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wiredspace.de; s=key1; t=1729327292; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+9nI9DyyvUkPvZXIQqw1VWeyaPfPWQnX8HfjjMPK6kA=; b=ieXOYAvMze+hHfzOiaKM/Qf6sExVXqPkebY4wyG2IM1wVLuyo/HL/AwZ4ohyHD7jv8vbt9 nhCLRaBGyTvC86IH4vbarsD0KOyH+xpXTfMD43FOul7OK0dYwZhAB+aE/IAyAykzVqI6PU QlbC2pA4+muS7HpPmjl4wfnkIhOtEOY= From: =?UTF-8?q?Thomas=20B=C3=B6hler?= To: Miguel Ojeda , Alex Gaynor , Jocelyn Falempe Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , rust-for-linux@vger.kernel.org, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Thomas=20B=C3=B6hler?= Subject: [PATCH v2 6/7] drm/panic: allow verbose boolean for clarity Date: Sat, 19 Oct 2024 10:22:51 +0200 Message-ID: <20241019084048.22336-7-witcher@wiredspace.de> In-Reply-To: <20241019084048.22336-1-witcher@wiredspace.de> References: <20241019084048.22336-1-witcher@wiredspace.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Clippy complains about a non-minimal boolean expression with `nonminimal_bool`: error: this boolean expression can be simplified --> drivers/gpu/drm/drm_panic_qr.rs:722:9 | 722 | (x < 8 && y < 8) || (x < 8 && y >=3D end) || (x >=3D end = && y < 8) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | =3D help: for further information visit https://rust-lang.github.io= /rust-clippy/master/index.html#nonminimal_bool =3D note: `-D clippy::nonminimal-bool` implied by `-D warnings` =3D help: to override `-D warnings` add `#[allow(clippy::nonminimal= _bool)]` help: try | 722 | !(x >=3D 8 || y >=3D 8 && y < end) || (x >=3D end && y < = 8) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 722 | (y >=3D end || y < 8) && x < 8 || (x >=3D end && y < 8) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ While this can be useful in a lot of cases, it isn't here because the line expresses clearly what the intention is. Simplifying the expression means losing clarity, so opt-out of this lint for the offending line. Fixes: cb5164ac43d0 ("drm/panic: Add a QR code panic screen") Reported-by: Miguel Ojeda Closes: https://github.com/Rust-for-Linux/linux/issues/1123 Signed-off-by: Thomas B=C3=B6hler Reviewed-by: Jocelyn Falempe --- v1 -> v2: turn the introduced explicit "return" statement into a block drivers/gpu/drm/drm_panic_qr.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_panic_qr.rs b/drivers/gpu/drm/drm_panic_qr= .rs index 58c46f366f76..2d4e367f0fcd 100644 --- a/drivers/gpu/drm/drm_panic_qr.rs +++ b/drivers/gpu/drm/drm_panic_qr.rs @@ -719,7 +719,10 @@ fn draw_finders(&mut self) { =20 fn is_finder(&self, x: u8, y: u8) -> bool { let end =3D self.width - 8; - (x < 8 && y < 8) || (x < 8 && y >=3D end) || (x >=3D end && y < 8) + #[expect(clippy::nonminimal_bool)] + { + (x < 8 && y < 8) || (x < 8 && y >=3D end) || (x >=3D end && y = < 8) + } } =20 // Alignment pattern: 5x5 squares in a grid. --=20 2.46.2