Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3546331pxp; Tue, 8 Mar 2022 17:07:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJwAJyVuNX+Jjud+C7AHbdvNCkUfK9njx8xKlbHAVldDp99KbibDrqr5zb4Bh2CaDaQpsqFH X-Received: by 2002:a63:78cd:0:b0:376:46c:6585 with SMTP id t196-20020a6378cd000000b00376046c6585mr16526844pgc.313.1646788059854; Tue, 08 Mar 2022 17:07:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646788059; cv=none; d=google.com; s=arc-20160816; b=u/F6xqO8d0hgpTsU98USntv/aH0b/VSBJI5pDgvmjfKQhduuFxbsIVUtwUyFtOy8+D ddt6oDdOwulBEFqZyjP5gj2Nsj4fVF3Qh6sH8t6UawYNmfECpvo3PrsgzbXyPVsE/ZZG z8+H8DFEDiOmDkxaOXxppbk4ij+92zUHGot2zsH7GPb5i4VeV1aXeD39aJ7zIx+XdNq3 Cxi1IK6MzmjYm2pSXjPMNyVrFvNuS6NLIhQB9s8AA9Ta+YQuLDa4fiypzsuduPOY1VUq +TW/sEUd572rsHxlGtzX5gSaitQCN2iEi6rZqlzF0oPCHQf1Z0WGFudX0/1Ig+hTE44N e4fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=QmFT5oX5WhVCf23K5lxag7wmD3+cmFNslYfO7qqS0x8=; b=gopTfbc6dqITN6TpMPbeA3toSIrHkllOHRK9iHrf5dRjxHriCIQQf5xqkCUfvXJ6nt hL/vBTqJ0unkkQ+WlMqLEzcjqjxBEWljVy3Lx0to9khULIfc3G/i40vDAUwWt7zzGhAE i5CCrjvdL9BAyznU3zjrY4HvdTjOFfOyz8kTe0agw6k7HmrDH6vyJ+nvZFXUrTQ7kv55 kuO6xgxsnumBdavj0akYW7qMoRiv31IvmwqAz3jNgNe/D4LA5OEcBOUK7RZaFqbzFNqu ebj6lTuFAppku4DdzLkyaRxBEOReezudkG8Kd4T1Zc7ZhJKwBoLlNeeYYJ7D6a/3hU2G urNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=O81yMp+2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id g12-20020a17090a4b0c00b001bef5f19d9dsi573207pjh.38.2022.03.08.17.07.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 17:07:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=O81yMp+2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DB8AE17C43B; Tue, 8 Mar 2022 16:12:44 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345100AbiCHJSF (ORCPT + 99 others); Tue, 8 Mar 2022 04:18:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230385AbiCHJSD (ORCPT ); Tue, 8 Mar 2022 04:18:03 -0500 Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 012E740A28 for ; Tue, 8 Mar 2022 01:17:05 -0800 (PST) Received: by mail-qt1-x831.google.com with SMTP id a14so2672225qtx.12 for ; Tue, 08 Mar 2022 01:17:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QmFT5oX5WhVCf23K5lxag7wmD3+cmFNslYfO7qqS0x8=; b=O81yMp+25f3i4Ba9tRiFQz+DjxkdQvAuD7tM0reOk09HYPu27Ez//y0oCxFyKkVdbX R/sSoBoeDiFo9s4tYx2XUwDDcYv11O60isHjmVp68H+cDOTvi8MFquadaAVoClk9ja+v tgqVtJBnuu5sX6ALII+KxtdSdNG5YJKvNgNsV1Ul3e8zr5lBnLNM1T5puAZuTVFRO7fD ksosDAjF0UEXLdmjHrelsegsOtaPWnWvGdg7sUT57j0chxw3HyjuLjYpPYcdYKd6K5Sg VpzY5pDcfNa8suOuQoEaU1G9l/32J/ptGF+spDzNB9CfSYivKYkjoiflodvPIwrU+pjK AQow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QmFT5oX5WhVCf23K5lxag7wmD3+cmFNslYfO7qqS0x8=; b=59j+BWf8nKAA5nBVw7BVJfOsoQ8KReXzNpmkVYIRIzC+BBBhMVka9ARi89+z/2gxXl xHi07G6XhT2jvPtn8dxwV9VCdh2fJkxVMPvKuevJm0LAYM+y07Fs8leXPCumtpZjih0i Z38qlnHIqMOwkDk04tgeR76ee2r2q6RfV4dBwmfJCAuVruZXyUszvbupZW+WrLFnfw5q zfh3Htdm9PgUGkbC+t1Jg0PBQX1jr8Mz3oG34LqKX4rUKLIOoziU0hf+mbhkWgPqVdGZ JtwQT0JONS2CvP57z1/fv6AIOaq8UYrj70+O52EPvaokNS6Ay4exaBShRM1nDyE3FWvS Qh/Q== X-Gm-Message-State: AOAM531yPOw6Mec1WQJemBB32ebdeDGtwh/JpVYMcaK2ayn9MrZ+iiG0 cG9IguZUjGptjuLiSEKpFDWi7MdFxoE= X-Received: by 2002:a05:622a:13c6:b0:2de:8901:e3dd with SMTP id p6-20020a05622a13c600b002de8901e3ddmr12911101qtk.16.1646731024127; Tue, 08 Mar 2022 01:17:04 -0800 (PST) Received: from localhost.localdomain ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id c6-20020ac87d86000000b002ddd9f33ed1sm10976726qtd.44.2022.03.08.01.17.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 01:17:03 -0800 (PST) From: cgel.zte@gmail.com X-Google-Original-From: deng.changcheng@zte.com.cn To: joonas.lahtinen@linux.intel.com Cc: rodrigo.vivi@intel.com, tvrtko.ursulin@linux.intel.com, airlied@linux.ie, daniel@ffwll.ch, ville.syrjala@linux.intel.com, hdegoede@redhat.com, lucas.demarchi@intel.com, deng.changcheng@zte.com.cn, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Zeal Robot Subject: [PATCH] drm/i915/vlv_dsi_pll: use min_t() to make code cleaner Date: Tue, 8 Mar 2022 09:16:55 +0000 Message-Id: <20220308091655.2078825-1-deng.changcheng@zte.com.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Changcheng Deng Use min_t() in order to make code cleaner. Reported-by: Zeal Robot Signed-off-by: Changcheng Deng --- 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); -- 2.25.1