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] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 29 Aug 2018 10:49:13 +0200
From:   Wolfram Sang <wsa@...-dreams.de>
To:     Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc:     Wolfram Sang <wsa+renesas@...g-engineering.com>,
        linux-mmc@...r.kernel.org, Ulf Hansson <ulf.hansson@...aro.org>,
        linux-renesas-soc@...r.kernel.org,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Jassi Brar <jaswinder.singh@...aro.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 6/6] mmc: tmio: refactor CLK_CTL bit calculation


> +	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.


Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists