Commit 59dc1c86 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Jonathan Cameron

iio:pressure: zpa2326: remove redundant "DEBUG" ifdef

The -Wempty-body gcc warning triggers in the newly added zpa2326 driver:

drivers/iio/pressure/zpa2326.c: In function 'zpa2326_dequeue_pressure':
drivers/iio/pressure/zpa2326.c:578:3: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]

The use of an empty statement behind 'if (...)' is harmless here, but
it shows that the dev_dbg() macro is not used correctly: when the "DEBUG"
macro is not set, dev_dbg() already defaults to a no-operation, though
one that lets the compiler know that the arguments are used, and lets
it check the format string.

Fixing this also simplifies the driver.

Fixes: 03b262f2 ("iio:pressure: initial zpa2326 barometer support")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent a1427af5
...@@ -147,12 +147,8 @@ struct zpa2326_private { ...@@ -147,12 +147,8 @@ struct zpa2326_private {
#define zpa2326_warn(_idev, _format, _arg...) \ #define zpa2326_warn(_idev, _format, _arg...) \
dev_warn(_idev->dev.parent, _format, ##_arg) dev_warn(_idev->dev.parent, _format, ##_arg)
#ifdef DEBUG
#define zpa2326_dbg(_idev, _format, _arg...) \ #define zpa2326_dbg(_idev, _format, _arg...) \
dev_dbg(_idev->dev.parent, _format, ##_arg) dev_dbg(_idev->dev.parent, _format, ##_arg)
#else
#define zpa2326_dbg(_idev, _format, _arg...)
#endif
bool zpa2326_isreg_writeable(struct device *dev, unsigned int reg) bool zpa2326_isreg_writeable(struct device *dev, unsigned int reg)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment