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

From: Ryan Mallon
Date: Fri Jul 15 2011 - 01:14:44 EST


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/