]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] smiapp: Add parentheses to macro arguments used in macros
authorSakari Ailus <sakari.ailus@iki.fi>
Tue, 9 Dec 2014 21:43:16 +0000 (18:43 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 23 Dec 2014 13:51:30 +0000 (11:51 -0200)
This makes the macros a little bit safer.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/i2c/smiapp/smiapp-quirk.h

index a24eb435eb280eabee5cf1d6f677b2941e544b1b..dac5566a2f7ad2d0afb6434a9f287325c785716e 100644 (file)
@@ -72,14 +72,14 @@ void smiapp_replace_limit(struct smiapp_sensor *sensor,
                .val = _val,            \
        }
 
-#define smiapp_call_quirk(_sensor, _quirk, ...)                                \
-       (_sensor->minfo.quirk &&                                        \
-        _sensor->minfo.quirk->_quirk ?                                 \
-        _sensor->minfo.quirk->_quirk(_sensor, ##__VA_ARGS__) : 0)
+#define smiapp_call_quirk(sensor, _quirk, ...)                         \
+       ((sensor)->minfo.quirk &&                                       \
+        (sensor)->minfo.quirk->_quirk ?                                \
+        (sensor)->minfo.quirk->_quirk(sensor, ##__VA_ARGS__) : 0)
 
-#define smiapp_needs_quirk(_sensor, _quirk)            \
-       (_sensor->minfo.quirk ?                         \
-        _sensor->minfo.quirk->flags & _quirk : 0)
+#define smiapp_needs_quirk(sensor, _quirk)             \
+       ((sensor)->minfo.quirk ?                        \
+        (sensor)->minfo.quirk->flags & _quirk : 0)
 
 extern const struct smiapp_quirk smiapp_jt8ev1_quirk;
 extern const struct smiapp_quirk smiapp_imx125es_quirk;