From: Joe Perches <joe@perches.com>
To: Bernard Zhao <bernard@vivo.com>,
Chun-Kuang Hu <chunkuang.hu@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Matthias Brugger <matthias.bgg@gmail.com>,
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
Subject: Re: [PATCH] drm/mediatek: remove unnecessary conversion to bool
Date: Sun, 14 Jun 2020 13:41:41 -0700 [thread overview]
Message-ID: <48891eaf60c5e0c449e573a906894db2c3a7b72c.camel@perches.com> (raw)
In-Reply-To: <20200612124007.4990-1-bernard@vivo.com>
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;
}
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
next prev parent reply other threads:[~2020-06-14 20:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-12 12:40 [PATCH] drm/mediatek: remove unnecessary conversion to bool Bernard Zhao
2020-06-12 13:09 ` Robin Murphy
2020-06-14 20:41 ` Joe Perches [this message]
2020-06-15 14:00 ` Chun-Kuang Hu
2020-06-16 2:16 ` Bernard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48891eaf60c5e0c449e573a906894db2c3a7b72c.camel@perches.com \
--to=joe@perches.com \
--cc=airlied@linux.ie \
--cc=bernard@vivo.com \
--cc=chunkuang.hu@kernel.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=opensource.kernel@vivo.com \
--cc=p.zabel@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox