public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: cgel.zte@gmail.com, joonas.lahtinen@linux.intel.com
Cc: tvrtko.ursulin@linux.intel.com, airlied@linux.ie,
	intel-gfx@lists.freedesktop.org, lucas.demarchi@intel.com,
	deng.changcheng@zte.com.cn, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, hdegoede@redhat.com,
	rodrigo.vivi@intel.com, Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] drm/i915/vlv_dsi_pll: use min_t() to make code cleaner
Date: Wed, 09 Mar 2022 10:46:01 +0200	[thread overview]
Message-ID: <87a6dz1pkm.fsf@intel.com> (raw)
In-Reply-To: <20220308091655.2078825-1-deng.changcheng@zte.com.cn>

On Tue, 08 Mar 2022, cgel.zte@gmail.com wrote:
> From: Changcheng Deng <deng.changcheng@zte.com.cn>
>
> Use min_t() in order to make code cleaner.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>

Thanks, pushed to drm-intel-next.

BR,
Jani.

> ---
>  drivers/gpu/drm/i915/display/vlv_dsi_pll.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/vlv_dsi_pll.c b/drivers/gpu/drm/i915/display/vlv_dsi_pll.c
> index df880f44700a..f801f7ec3f9a 100644
> --- a/drivers/gpu/drm/i915/display/vlv_dsi_pll.c
> +++ b/drivers/gpu/drm/i915/display/vlv_dsi_pll.c
> @@ -393,10 +393,7 @@ static void glk_dsi_program_esc_clock(struct drm_device *dev,
>  	/* Calculate TXESC2 divider */
>  	div2_value = DIV_ROUND_UP(div1_value, txesc1_div);
>  
> -	if (div2_value < 10)
> -		txesc2_div = div2_value;
> -	else
> -		txesc2_div = 10;
> +	txesc2_div = min_t(u32, div2_value, 10);
>  
>  	intel_de_write(dev_priv, MIPIO_TXESC_CLK_DIV1,
>  		       (1 << (txesc1_div - 1)) & GLK_TX_ESC_CLK_DIV1_MASK);

-- 
Jani Nikula, Intel Open Source Graphics Center

      reply	other threads:[~2022-03-09  8:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-08  9:16 [PATCH] drm/i915/vlv_dsi_pll: use min_t() to make code cleaner cgel.zte
2022-03-09  8:46 ` Jani Nikula [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a6dz1pkm.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=airlied@linux.ie \
    --cc=cgel.zte@gmail.com \
    --cc=deng.changcheng@zte.com.cn \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hdegoede@redhat.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucas.demarchi@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=tvrtko.ursulin@linux.intel.com \
    --cc=zealci@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox