Thread (153 messages) 153 messages, 15 authors, 2015-06-24

[PATCH v3 1/9] regmap: Introduce regmap_get_max_register.

From: joe@perches.com (Joe Perches)
Date: 2015-03-24 23:23:25
Also in: linux-api, linux-arm-msm, linux-devicetree, lkml

On Tue, 2015-03-24 at 23:05 +0000, Srinivas Kandagatla wrote:
On 24/03/15 22:36, Mark Brown wrote:
quoted
quoted
+int regmap_get_max_register(struct regmap *map)
+{
+	return map->max_register ? : -EINVAL;
+}
Please write the logic out properly, don't abuse the ternery operator.
Am happy to change it to your preference in next version, but this GNU 
extensions widely used in the kernel

$  grep -rR "return.*? :" ./linux | wc -l
115
Double that when you add the ?: variants

$ git grep -E "return.*\?\s*:" | wc -l
253

There are ~530 uses like:

	return <foo> ? <foo> :
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help