summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2025-09-19 22:29:57 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2025-09-23 18:11:37 +0300
commit15bdae1072061db72027192badb276f95094da5f (patch)
treeb8ada36ccd204b9ca486efc87c3d39f91a887b5e /drivers/gpu
parente407ea78abdf20bb64998e178b7944dd297ffcb3 (diff)
downloadlinux-15bdae1072061db72027192badb276f95094da5f.tar.xz
drm/i915: Flatten sanitize_wm_latency() a bit
Move the inner loop out from the outer loop in sanitize_wm_latency() to flatten things a bit. Easier to read flat code. v2: Move the inner loop out completely (Luca) Cc: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250919193000.17665-11-ville.syrjala@linux.intel.com Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/display/skl_watermark.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c b/drivers/gpu/drm/i915/display/skl_watermark.c
index 1acb9285bd05..d83772c6ea9a 100644
--- a/drivers/gpu/drm/i915/display/skl_watermark.c
+++ b/drivers/gpu/drm/i915/display/skl_watermark.c
@@ -3228,14 +3228,12 @@ static void sanitize_wm_latency(struct intel_display *display)
* of the punit to satisfy this requirement.
*/
for (level = 1; level < num_levels; level++) {
- if (wm[level] == 0) {
- int i;
-
- for (i = level + 1; i < num_levels; i++)
- wm[i] = 0;
- return;
- }
+ if (wm[level] == 0)
+ break;
}
+
+ for (level = level + 1; level < num_levels; level++)
+ wm[level] = 0;
}
static void