On Fri, 2025-09-19 at 22:29 +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <[email protected]>
> 
> 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 <[email protected]>
> Signed-off-by: Ville Syrjälä <[email protected]>
> ---

Reviewed-by: Luca Coelho <[email protected]>

--
Cheers,
Luca.


>  drivers/gpu/drm/i915/display/skl_watermark.c | 12 +++++-------
>  1 file 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

Reply via email to