lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <AGQAVQB8CJTteCgzBUXE5Kra.3.1592273800065.Hmail.bernard@vivo.com>
Date:   Tue, 16 Jun 2020 10:16:40 +0800 (GMT+08:00)
From:   Bernard <bernard@...o.com>
To:     Chun-Kuang Hu <chunkuang.hu@...nel.org>
Cc:     Joe Perches <joe@...ches.com>,
        Chun-Kuang Hu <chunkuang.hu@...nel.org>,
        Philipp Zabel <p.zabel@...gutronix.de>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        Matthias Brugger <matthias.bgg@...il.com>,
        DRI Development <dri-devel@...ts.freedesktop.org>,
        Linux ARM <linux-arm-kernel@...ts.infradead.org>,
        "moderated list:ARM/Mediatek SoC support" 
        <linux-mediatek@...ts.infradead.org>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        opensource.kernel@...o.com
Subject: Re:Re: [PATCH] drm/mediatek: remove unnecessary conversion to bool



发件人:Chun-Kuang Hu <chunkuang.hu@...nel.org>
发送日期:2020-06-15 22:00:52
收件人:Joe Perches <joe@...ches.com>
抄送人:Bernard Zhao <bernard@...o.com>,Chun-Kuang Hu <chunkuang.hu@...nel.org>,Philipp Zabel <p.zabel@...gutronix.de>,David Airlie <airlied@...ux.ie>,Daniel Vetter <daniel@...ll.ch>,Matthias Brugger <matthias.bgg@...il.com>,DRI Development <dri-devel@...ts.freedesktop.org>,Linux ARM <linux-arm-kernel@...ts.infradead.org>,"moderated list:ARM/Mediatek SoC support" <linux-mediatek@...ts.infradead.org>,linux-kernel <linux-kernel@...r.kernel.org>,opensource.kernel@...o.com
主题:Re: [PATCH] drm/mediatek: remove unnecessary conversion to bool>Joe Perches <joe@...ches.com> 於 2020年6月15日 週一 上午4:41寫道:
>>
>> 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;
>> }
>
>I like the second one.

Hi:

This modification is clear and easy to understand.
I will update the patch and resubmit.
Thanks!

BR//Bernard

>>
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@...ts.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ