Commit 15bdae10 authored by Ville Syrjälä's avatar Ville Syrjälä
Browse files

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: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250919193000.17665-11-ville.syrjala@linux.intel.com


Reviewed-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent e407ea78
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -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