Re: [PATCH 6/6] clk: Add initial WM831x clock driver

Ryan Mallon
2011-07-15T05:14:28Z

On 15/07/11 15:05, Mark Brown wrote:
> On Thu, Jul 14, 2011 at 08:53:39PM -0600, Grant Likely wrote:
>> On Mon, Jul 11, 2011 at 11:53:57AM +0900, Mark Brown wrote:
>>> + if (clkdata->xtal_ena)
>>> + return 0;
>>> + else
>>> + return -EPERM;
>>> +}
>> Nit: return clkdata->xtal_ena ? 0 : -EPERM;
>> Just makes for more concise code.
> I have an extremely strong dislike of the ternery operator, I find it
> does nothing for legibility.
>
I prefer this:

if (!clkdata->xtal_ena)
return -EPERM;

return 0;
}

Which makes the error check clear and makes the success case visible
right at the bottom of the function.

~Ryan