Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp350658pxp; Wed, 9 Mar 2022 04:23:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJxCtk4kwsLhUg+aRACzrOn+OWiIQs0lS+z0whpQooiKVJcE4noxmZyTATglNkpmwAeNB+eI X-Received: by 2002:a17:907:ea3:b0:6da:7d41:ec73 with SMTP id ho35-20020a1709070ea300b006da7d41ec73mr18369596ejc.333.1646828618471; Wed, 09 Mar 2022 04:23:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646828618; cv=none; d=google.com; s=arc-20160816; b=nZ+dsbTJ3M0jwa3t5zpY8MChuoOI3bUIAOuEs57V82AfGOs4ZAxBAdcXfnbv1eJvld 9lMs6lcNnHFkcmEBtmWHI+zQHBGMf0dGbxPfxkometoE5byNtpPlwI2uuhoYtRwsBKDh 7ZLzwo9eIvnLc7CiwN8+KNSAyPsIRaYyogSguJRkGEpdVsVCa/uExyzmRfb71fOYOy5g VtCxMlnPLY/GCihU9LYOufLuW1AXKnqxjta3diWItTUv2LpzjMVdm9cSwE+JvG44CNtH UfFNAm/pJM6Mt8WPXfXV0Pli1/2m2Vp5JkyQGUUlfmgwYOaGi5z+GfvxvEmg/xOb94AW Q0Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :organization:in-reply-to:subject:cc:to:from:dkim-signature; bh=xuNYlSS77pbx00aDfZuNGlcBWeiO84rj7j4C/kn0ihE=; b=0lHdEFeMyVXNK28q2vUfij56Ehiha6WblhdOHtqLFmji9NyHhI6tTC4Svfp1esO+Ey fgXAJyTtbbbW0BYZAqTNN8Rsy9kt9R53kmhqckkxGJnkRDBFY44VrWe1spRAMtHb6B4F O+Un9bQ+18EfB7lcvBgLOxpVYPWUl6sndzusBCXbBLhHCa18jR+yc+q4PnfJ8z3t7pwN J5KBOGO0+CoNnBCSiMY/LkeCDOs6m4OErvdj2eDF74t79XdnO1N+arFCu4k2awQ6lj7J va59a3XyvLj7rKW4IpxtYkLW3bbjuNWdkkn2a2Jt4Nxx9X8THDMrOAQZvU0XSLaS40Kd rMaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IvZjlNFx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw23-20020a056402229700b004160ef6f1afsi993283edb.530.2022.03.09.04.23.12; Wed, 09 Mar 2022 04:23:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IvZjlNFx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231330AbiCIIrG (ORCPT + 99 others); Wed, 9 Mar 2022 03:47:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229525AbiCIIrG (ORCPT ); Wed, 9 Mar 2022 03:47:06 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 744AF1617F7 for ; Wed, 9 Mar 2022 00:46:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646815567; x=1678351567; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=7jjpc8d9He9z6dyZOnytX0AgMjz8sxRIr5YFBPwkC9w=; b=IvZjlNFxN6LuRNt9dVLNpLxHLp3H5PIWSriXUCq/EsbcrTTn2jOJghjV p8/+Ip9dCcFgrCTJeL+pEKG3557pVYTRTFWBDkgu8ghBNY1/jpXqpN+D+ 5lsp/b2q8JkQr1BXL5jMibSOfj+5gJJe8ArCGw2Tj0ERI/OFwKPrIeH2R X6LzATmE57mlkDvD1xmT51ULBeqyupWtnmw0VPaVxxC61/HjkWE9kna6K eYCwiMpNcoiIdq516y25seGCIATpM6in5kCMxS8KwLnPQPvuzGOSoSNWX t07sYHYesITDCvaLsFgip1WcNp8EsgKLTzK94TClR8zZ5CGhG9r8INqyB A==; X-IronPort-AV: E=McAfee;i="6200,9189,10280"; a="235531271" X-IronPort-AV: E=Sophos;i="5.90,167,1643702400"; d="scan'208";a="235531271" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2022 00:46:07 -0800 X-IronPort-AV: E=Sophos;i="5.90,167,1643702400"; d="scan'208";a="537919937" Received: from byrnec1x-mobl.ger.corp.intel.com (HELO localhost) ([10.252.29.235]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2022 00:46:03 -0800 From: Jani Nikula 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 Subject: Re: [PATCH] drm/i915/vlv_dsi_pll: use min_t() to make code cleaner In-Reply-To: <20220308091655.2078825-1-deng.changcheng@zte.com.cn> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20220308091655.2078825-1-deng.changcheng@zte.com.cn> Date: Wed, 09 Mar 2022 10:46:01 +0200 Message-ID: <87a6dz1pkm.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Tue, 08 Mar 2022, cgel.zte@gmail.com wrote: > From: Changcheng Deng > > Use min_t() in order to make code cleaner. > > Reported-by: Zeal Robot > Signed-off-by: Changcheng Deng 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