[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPDyKFq6wX9jP0c5688fWVAmnZja9OZXbECwoKbKBXuM2r5cbg@mail.gmail.com>
Date: Thu, 30 Aug 2018 13:51:49 +0200
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Wolfram Sang <wsa@...-dreams.de>
Cc: Masahiro Yamada <yamada.masahiro@...ionext.com>,
Wolfram Sang <wsa+renesas@...g-engineering.com>,
"linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
Linux-Renesas <linux-renesas-soc@...r.kernel.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Jassi Brar <jaswinder.singh@...aro.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 6/6] mmc: tmio: refactor CLK_CTL bit calculation
On 29 August 2018 at 10:49, Wolfram Sang <wsa@...-dreams.de> wrote:
>
>> + if (divisor <= 1) {
>> + clk_sel = 1;
>> + clk = 0;
>> + } else {
>> + clk_sel = 0;
>> + /* bit7 set: 1/512, ... bit0 set:1/4, all bits clear: 1/2 */
>> + clk = roundup_pow_of_two(divisor) >> 2;
>> + }
>
> What about
>
> clk_sel = (divisor <= 1);
> clk = clk_sel ? 0 : (roundup_pow_of_two(divisor) >> 2)
>
> More concise, but I think still readable. I don't mind super much,
> though.
Right. So, may I apply Yamada-san's original patch (adding your
tested/reviewed-by tag) and the above as a code-cleanup for you to
address on top?
Kind regards
Uffe
Powered by blists - more mailing lists