linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Gregor Boirie <gregor.boirie@parrot.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] io:pressure: zpa2326: remove redundant "DEBUG" ifdef
Date: Thu, 22 Sep 2016 18:44:57 +0100	[thread overview]
Message-ID: <c775fcb7-090e-7153-3706-a65db2ac7dff@kernel.org> (raw)
In-Reply-To: <20160922094253.2202232-1-arnd@arndb.de>

On 22/09/16 10:42, Arnd Bergmann wrote:
> 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: 03b262f2bbf4 ("iio:pressure: initial zpa2326 barometer support")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixed up patch title with an extra i and applied to the togreg branch of iio.git
initially pushed out as testing for the autobuilders to play with it.

Thanks,

Jonathan
> ---
>  drivers/iio/pressure/zpa2326.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/iio/pressure/zpa2326.c b/drivers/iio/pressure/zpa2326.c
> index 19d2eb46fda6..c720c3ac0b9b 100644
> --- a/drivers/iio/pressure/zpa2326.c
> +++ b/drivers/iio/pressure/zpa2326.c
> @@ -147,12 +147,8 @@ struct zpa2326_private {
>  #define zpa2326_warn(_idev, _format, _arg...) \
>  	dev_warn(_idev->dev.parent, _format, ##_arg)
>  
> -#ifdef DEBUG
>  #define zpa2326_dbg(_idev, _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)
>  {
> 


      reply	other threads:[~2016-09-22 17:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-22  9:42 [PATCH] io:pressure: zpa2326: remove redundant "DEBUG" ifdef Arnd Bergmann
2016-09-22 17:44 ` Jonathan Cameron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c775fcb7-090e-7153-3706-a65db2ac7dff@kernel.org \
    --to=jic23@kernel.org \
    --cc=arnd@arndb.de \
    --cc=gregor.boirie@parrot.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).