Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp458742ybg; Fri, 12 Jun 2020 06:11:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWRMmcQ7uOvnLOCHQK/mVjZA1mUGMLxfhb2ji7s31TEZVnHrZh+vTR29tXVs6wRFjTGRaD X-Received: by 2002:a50:d302:: with SMTP id g2mr6612329edh.312.1591967505506; Fri, 12 Jun 2020 06:11:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591967505; cv=none; d=google.com; s=arc-20160816; b=kOygtv2cgOQbk/nGqWBcr4HLV8vl0ZSdw7DN/v3N244cMvgEPRWnPSU78jxtckIo0K ywaGt3I/Pvbtn9ZW+JuOXLb70lfLaLQVH/784JRkmQAeht1xfTZALo2Fv/9AV0Gw3SGY dxPAliQEyV5OVe3nZerWSqpf9gMi0vMq4Dz4FmZXScN+/C1A+XXRTAY91T1O3WRW/Aa1 MclSqti1P3pl5KdcyW+kNToqHClwXCnYEM7DDYJHB1cLYDc/+AM7ZQWjADtyWV725aCB QjjH5Gxb/Nk5p4fuDTIKo5dw1x8Hg8SdE0sn28zbQtv8Xu82PJmmAMoSSGFIGDHx78J/ +Y5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=n14HC4fLyGq9gfs9JKFxJS9O1j1PH4ranb1XrGrAdLs=; b=SVanIXWfBTvEYXupkqnlaJ4o1fjsr4L2ScbZFUgszJ1wPNq9mOyAI6EOuvWgwOvLpv OsVA5CJ++zNZimNj9AxqsDsRV/wCV6R334+7UGXAguTH2tjIXqx8B0XkmmiG17oZTYPu +FJeTB/1DLcacjLGnt9gAhT0Zj1rn2Q11pjOY68AvxtPlvv5BTKJOWU8b/wk5hkk9TYE N+az0+/CODFjQ1IJMaQoOs4Ri8OHp+v1cuEG30nWluEeArPabbQiYY01JQ9hNx8FUvan wE/MwyOqJL8T1LASj2e2jJMbvroi2PUgW7WbgkkGUgq/TYLYcdMZL/kj5pqcjP7PxLkV ooQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dm20si4228859ejc.159.2020.06.12.06.11.21; Fri, 12 Jun 2020 06:11:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726290AbgFLNJR (ORCPT + 99 others); Fri, 12 Jun 2020 09:09:17 -0400 Received: from foss.arm.com ([217.140.110.172]:36196 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726112AbgFLNJQ (ORCPT ); Fri, 12 Jun 2020 09:09:16 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D93F61F1; Fri, 12 Jun 2020 06:09:15 -0700 (PDT) Received: from [10.57.9.128] (unknown [10.57.9.128]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 197103F6CF; Fri, 12 Jun 2020 06:09:13 -0700 (PDT) Subject: Re: [PATCH] drm/mediatek: remove unnecessary conversion to bool To: Bernard Zhao , Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com References: <20200612124007.4990-1-bernard@vivo.com> From: Robin Murphy Message-ID: Date: Fri, 12 Jun 2020 14:09:07 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200612124007.4990-1-bernard@vivo.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-06-12 13:40, Bernard Zhao wrote: > In function mtk_dsi_clk_hs_state, remove unnecessary conversion > to bool return, this change is to make the code a bit readable. > > Signed-off-by: Bernard Zhao > --- > drivers/gpu/drm/mediatek/mtk_dsi.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c > index 270bf22c98fe..4491e64b3f06 100644 > --- a/drivers/gpu/drm/mediatek/mtk_dsi.c > +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c > @@ -319,7 +319,7 @@ static bool mtk_dsi_clk_hs_state(struct mtk_dsi *dsi) > u32 tmp_reg1; > > tmp_reg1 = readl(dsi->regs + DSI_PHY_LCCON); > - return ((tmp_reg1 & LC_HS_TX_EN) == 1) ? true : false; > + return ((tmp_reg1 & LC_HS_TX_EN) == 1); FWIW the "== 1" is also redundant, not to mention a little confusing - unless you go and look up the definition of LC_HS_TX_EN, it looks like this is doing something more than simply testing if a single bit is set. Robin. > } > > static void mtk_dsi_clk_hs_mode(struct mtk_dsi *dsi, bool enter) >