Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1190068ybt; Sun, 14 Jun 2020 13:46:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkzToLRue7vafhfk/xJ2Ng24/L6OT8YBr81wEIHkvb7HUj6wexmEH8T9Ub/NBrt2yDewfg X-Received: by 2002:a17:906:e05:: with SMTP id l5mr24409114eji.318.1592167565772; Sun, 14 Jun 2020 13:46:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592167565; cv=none; d=google.com; s=arc-20160816; b=uAsXTZHWM8Q3HDOuQnLQ5CCoI4jDEWHfBVAmsX/KCOjFFv1E7AVw8gqOjhcbMCrtx/ vDB7Tw6+kqQROEKTgi+wgybd1VSVl0ZAGfo+LzB37miP1NC0xCMB+uanmAB5AxJmQM68 9TUgVeuhz5A85eobdAEP5M6o3sAoN2eFsykWrh1eMsI55qlG+5WIl/Nm0pE/rL2rrEGx gJjl3m9Hy/vVD3fKOldkj4YIxdseRyqD/ukKkXkVpt8doUVfNWGCi2eBLag/QaAi3DPB UJ359tAyMtY5Z0RSdiYSAvs13yHXD+QHWOUGasXGjn915IltEi6Mci9f2ts1ISSwAkRr +v/w== 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:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=yF3eC28gekuiKF6fL5wFsFGak7u5Xv3t4Q+9Yl5c3jg=; b=1LouFVebp39VUSqAJOFIOGyQ15ZaTNS5rGdyEOT9Dlwf5N0oVgbIJFq3R4FhurjrCn Aw1TAm6/sAgHP/d49rmIobw1MGFgGh4Vfhwtrn8c0G0FFN+EFYfkeGOGkXFPw6t6KVHC MZfwlVT3+0CWGdSrwDZDr+uzh8NIgrNdpfoVqWRZYn/sRgcfxbfDQAhoK3Qw2xr1vPqF xj424pPCfyD+8TFZkuhr+2vkdzoI+IsDrUcUXMwbdcjZ8jEJ7w/nAsU6SlUsII5zVi1x 5m1lpaISUvlDOH+tne9Ym0JBUJd4faXbGic0tQn1Q0VmOoyiS9J7wPU/TF4dh3qkvdo3 JsSA== 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 g10si7064936edr.463.2020.06.14.13.45.41; Sun, 14 Jun 2020 13:46:05 -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 S1727805AbgFNUlq (ORCPT + 99 others); Sun, 14 Jun 2020 16:41:46 -0400 Received: from smtprelay0112.hostedemail.com ([216.40.44.112]:42896 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726648AbgFNUlp (ORCPT ); Sun, 14 Jun 2020 16:41:45 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay02.hostedemail.com (Postfix) with ESMTP id 79E4F15E7; Sun, 14 Jun 2020 20:41:44 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:968:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3870:3871:4321:4605:5007:9121:10004:10400:10848:11026:11232:11233:11473:11657:11658:11914:12043:12048:12296:12297:12438:12679:12740:12760:12895:13069:13311:13357:13439:14659:14721:21080:21433:21451:21627:21990:30012:30054:30070:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: error76_4e1659226df0 X-Filterd-Recvd-Size: 1906 Received: from XPS-9350.home (unknown [47.151.136.130]) (Authenticated sender: joe@perches.com) by omf09.hostedemail.com (Postfix) with ESMTPA; Sun, 14 Jun 2020 20:41:42 +0000 (UTC) Message-ID: <48891eaf60c5e0c449e573a906894db2c3a7b72c.camel@perches.com> Subject: Re: [PATCH] drm/mediatek: remove unnecessary conversion to bool From: Joe Perches 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 Date: Sun, 14 Jun 2020 13:41:41 -0700 In-Reply-To: <20200612124007.4990-1-bernard@vivo.com> References: <20200612124007.4990-1-bernard@vivo.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.2-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2020-06-12 at 20:40 +0800, 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. [] > diff --git 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); Given: drivers/gpu/drm/mediatek/mtk_dsi.c:#define LC_HS_TX_EN BIT(0) This is likely clearer as return tmp_reg1 & LC_HS_TX_EN; or even static bool mtk_dsi_clk_hs_state(struct mtk_dsi *dsi) { return readl(dsi->regs + DSI_PHY_LCCON) & LC_HS_TX_EN; }