Linux-mediatek Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2] drm/mediatek: remove unnecessary conversion to bool
@ 2020-06-16  6:51 Bernard Zhao
  2020-06-28 14:19 ` Chun-Kuang Hu
  0 siblings, 1 reply; 2+ messages in thread
From: Bernard Zhao @ 2020-06-16  6:51 UTC (permalink / raw)
  To: Chun-Kuang Hu, Philipp Zabel, David Airlie, Daniel Vetter,
	Matthias Brugger, dri-devel, linux-arm-kernel, linux-mediatek,
	linux-kernel
  Cc: opensource.kernel, Bernard Zhao

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 <bernard@vivo.com>
---
Changes since V1:
*optimize to make the code a bit more clear.

Link for V1:
*https://lore.kernel.org/patchwork/patch/1255327/
---
 drivers/gpu/drm/mediatek/mtk_dsi.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
index 4491e64b3f06..840cc9b9efc8 100644
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
@@ -316,10 +316,7 @@ static void mtk_dsi_lane0_ulp_mode_leave(struct mtk_dsi *dsi)
 
 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);
+	return (readl(dsi->regs + DSI_PHY_LCCON) & LC_HS_TX_EN);
 }
 
 static void mtk_dsi_clk_hs_mode(struct mtk_dsi *dsi, bool enter)
-- 
2.17.1


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] drm/mediatek: remove unnecessary conversion to bool
  2020-06-16  6:51 [PATCH v2] drm/mediatek: remove unnecessary conversion to bool Bernard Zhao
@ 2020-06-28 14:19 ` Chun-Kuang Hu
  0 siblings, 0 replies; 2+ messages in thread
From: Chun-Kuang Hu @ 2020-06-28 14:19 UTC (permalink / raw)
  To: Bernard Zhao
  Cc: Chun-Kuang Hu, Philipp Zabel, opensource.kernel, David Airlie,
	linux-kernel, DRI Development,
	moderated list:ARM/Mediatek SoC support, Daniel Vetter,
	Matthias Brugger, Linux ARM

Hi, Bernard:

Bernard Zhao <bernard@vivo.com> 於 2020年6月16日 週二 下午2:51寫道:
>
> In function mtk_dsi_clk_hs_state, remove unnecessary conversion
> to bool return, this change is to make the code a bit readable.

Applied to mediatek-drm-fixes [1], thanks.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-fixes

Regards,
Chun-Kuang.

>
> Signed-off-by: Bernard Zhao <bernard@vivo.com>
> ---
> Changes since V1:
> *optimize to make the code a bit more clear.
>
> Link for V1:
> *https://lore.kernel.org/patchwork/patch/1255327/
> ---
>  drivers/gpu/drm/mediatek/mtk_dsi.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
> index 4491e64b3f06..840cc9b9efc8 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> @@ -316,10 +316,7 @@ static void mtk_dsi_lane0_ulp_mode_leave(struct mtk_dsi *dsi)
>
>  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);
> +       return (readl(dsi->regs + DSI_PHY_LCCON) & LC_HS_TX_EN);
>  }
>
>  static void mtk_dsi_clk_hs_mode(struct mtk_dsi *dsi, bool enter)
> --
> 2.17.1
>

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16  6:51 [PATCH v2] drm/mediatek: remove unnecessary conversion to bool Bernard Zhao
2020-06-28 14:19 ` Chun-Kuang Hu

Linux-mediatek Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mediatek/0 linux-mediatek/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mediatek linux-mediatek/ https://lore.kernel.org/linux-mediatek \
		linux-mediatek@lists.infradead.org
	public-inbox-index linux-mediatek

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-mediatek


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git