Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1689861ybt; Mon, 15 Jun 2020 07:03:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5neoBrKRI3PQmYXtEqNnBPW/OnNeeWFEbX2SmXREyjvkhsymCArk5tBRKNWGcpVmQaerA X-Received: by 2002:a17:906:d9cd:: with SMTP id qk13mr25306830ejb.268.1592229806344; Mon, 15 Jun 2020 07:03:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592229806; cv=none; d=google.com; s=arc-20160816; b=lGTJiqveXnYfqLSLrVoQ7tkGPppTioCdj5dUxqNkY4wuQNchJX2C96/Z78bEywfExR q76f5dAww2ohTlKKprQWUotXye0FhM7iARLG12VfodTHxVTnkWL37rZ4vJ+D8Q0HsfV7 fnOvhkq0xrauamcgKIq1heLSWJUeB9CejQKI3zOb4+OtAVUdjW7a1WSrmyDnHzDuugXF tBMWu55CoT34pwWfKMEmRsFv3NODDH8d09Po2CT7IFl8wP2N31Zn7a33mSd/1ERpANWi m+b+bbHvOoDa2R2eMqUJGU4TCVGOPBEzt20JNRVdPP4YUOj5R66poosrw3B7Nn8982et N5Pw== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=pHJbSKFvlDQuq6J+ILcbpPgAwTii0pdhsTnnKP1osLc=; b=Wzki+6yVbhhRinwKHM5SNkLNB/ctFlvnqMYpqOfhhOnE7XzP+C77sMXu8NFoKQGviD d1lKv6HjIMZmqO7syZTMqO36n+WrWYk9cOeemDSzU30JCpGJp176CUq2mPSoiyC9MNrO V3ZZ5H7rFJsypRKK22X2/nsjoTQumFxC9aZy86GTf/AJj3abU5blHyRFN8MyD3RtCTGU 2ViOQU8mL7cpU4tdFE77vPawWSvahdsao2FdUq9m41+PzphkU6KfFRzMgjqdRNIPOYgJ AUOeXHCdUcfIPlpwu+V6iEC52ESPAxX2X6c85GrFHImPsgjlFPnR72AaRLySdDjuh/Tb Do+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="K/KRxrBX"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v3si9506339eja.251.2020.06.15.07.03.01; Mon, 15 Jun 2020 07:03:26 -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; dkim=pass header.i=@kernel.org header.s=default header.b="K/KRxrBX"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729990AbgFOOBH (ORCPT + 99 others); Mon, 15 Jun 2020 10:01:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:60776 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728773AbgFOOBG (ORCPT ); Mon, 15 Jun 2020 10:01:06 -0400 Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2A0A6207DA for ; Mon, 15 Jun 2020 14:01:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592229665; bh=4ZrW2imLQHEXjli9BMhglqZFIS7OW1wia511Wm26A1U=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=K/KRxrBXnu5c9C61GD1bP9YnkYAS8ruyvyXbp1IrTBwyjJw+wcLWprnxL6Pt+0wlm iClKngonSjFnN4GcpEb/ADtDlsiWUqvVUKQ8JDCe6hgbWqgJU1vZkvsgZoL6NfpZR3 B5ltzhb/M60tsPAqEQpKTzCJp69GVQrDZHrDNus0= Received: by mail-ed1-f54.google.com with SMTP id k8so11606225edq.4 for ; Mon, 15 Jun 2020 07:01:05 -0700 (PDT) X-Gm-Message-State: AOAM532nlcBxCNEVJPX9R+p0EyRx4yDFwXV8TAUSXGJxzzHLGe8TRTL/ JX/K/cv2QnehA8XMrotuq77O75VxYOliAr7vXw== X-Received: by 2002:a05:6402:1247:: with SMTP id l7mr22777542edw.61.1592229663698; Mon, 15 Jun 2020 07:01:03 -0700 (PDT) MIME-Version: 1.0 References: <20200612124007.4990-1-bernard@vivo.com> <48891eaf60c5e0c449e573a906894db2c3a7b72c.camel@perches.com> In-Reply-To: <48891eaf60c5e0c449e573a906894db2c3a7b72c.camel@perches.com> From: Chun-Kuang Hu Date: Mon, 15 Jun 2020 22:00:52 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] drm/mediatek: remove unnecessary conversion to bool To: Joe Perches Cc: Bernard Zhao , Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , DRI Development , Linux ARM , "moderated list:ARM/Mediatek SoC support" , linux-kernel , opensource.kernel@vivo.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Joe Perches =E6=96=BC 2020=E5=B9=B46=E6=9C=8815=E6=97=A5 = =E9=80=B1=E4=B8=80 =E4=B8=8A=E5=8D=884:41=E5=AF=AB=E9=81=93=EF=BC=9A > > 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/media= tek/mtk_dsi.c > [] > > @@ -319,7 +319,7 @@ static bool mtk_dsi_clk_hs_state(struct mtk_dsi *ds= i) > > u32 tmp_reg1; > > > > tmp_reg1 =3D readl(dsi->regs + DSI_PHY_LCCON); > > - return ((tmp_reg1 & LC_HS_TX_EN) =3D=3D 1) ? true : false; > > + return ((tmp_reg1 & LC_HS_TX_EN) =3D=3D 1); > > Given: > > drivers/gpu/drm/mediatek/mtk_dsi.c:#define LC_HS_TX_EN B= IT(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; > } I like the second one. > > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel