[PATCH v1 08/10] drm/i915/casf: invert loop's breaking logic

Michał Grzelak
2026-03-28T14:33:23Z

skl_scaler_get_config()'s loop is skipped when specified condition is
met and broken when the condition is not met. Equivalently, invert the
condition and break the loop.

Cc: Nemesa Garg <nemesa.garg@intel.com>
Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Michał Grzelak <michal.grzelak@intel.com>
---
drivers/gpu/drm/i915/display/skl_scaler.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c
index 802130df6561..9318fd1bcc45 100644
--- a/drivers/gpu/drm/i915/display/skl_scaler.c
+++ b/drivers/gpu/drm/i915/display/skl_scaler.c
@@ -977,10 +977,8 @@ void skl_scaler_get_config(struct intel_crtc_state *crtc_state)
u32 ctl;

ctl = intel_de_read(display, SKL_PS_CTRL(crtc->pipe, scaler_id));
- if ((ctl & (PS_SCALER_EN | PS_BINDING_MASK)) != (PS_SCALER_EN | PS_BINDING_PIPE))
- continue;
-
- break;
+ if ((ctl & (PS_SCALER_EN | PS_BINDING_MASK)) == (PS_SCALER_EN | PS_BINDING_PIPE))
+ break;
}

/* Read CASF regs for second scaler */
--
2.45.2