Re: [PATCH v3 6/6] mmc: tmio: refactor CLK_CTL bit calculation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux