[alsa-devel] [PATCH] ASoC: let snd_soc_update_bits() return an error code

Timur Tabi timur at freescale.com
Mon Jan 10 20:35:45 CET 2011


On Mon, Jan 10, 2011 at 1:29 PM, Mark Brown
<broonie at opensource.wolfsonmicro.com> wrote:
> On Mon, Jan 10, 2011 at 01:28:33PM -0600, Timur Tabi wrote:
>
>> +     ret = old = snd_soc_read(codec, reg);
>> +     if (ret < 0)
>> +             return ret;
>
> Please don't use multiple assignments in a single statement, it does
> nothing for legibility.

Bummer.  I really like that trick.  It's just so much more elegant than:

	ret = snd_soc_read(codec, reg);
	if (ret < 0)
		return ret;

	old = ret;

-- 
Timur Tabi
Linux kernel developer at Freescale


More information about the Alsa-devel mailing list