linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org, Arnd Bergmann <arnd@arndb.de>,
	Hans-Christian Noren Egtvedt <egtvedt@samfundet.no>,
	Vineet Gupta <vgupta@synopsys.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 11/13] MIPS: octeon: avoid empty-body warning
Date: Tue, 17 Jan 2017 16:18:45 +0100	[thread overview]
Message-ID: <20170117151911.4109452-11-arnd@arndb.de> (raw)
In-Reply-To: <20170117151911.4109452-1-arnd@arndb.de>

gcc-6 reports a harmless build warning:

arch/mips/cavium-octeon/dma-octeon.c: In function 'octeon_dma_alloc_coherent':
arch/mips/cavium-octeon/dma-octeon.c:179:3: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]

We can fix this by rearranging the code slightly using the
IS_ENABLED() macro.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/mips/cavium-octeon/dma-octeon.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/arch/mips/cavium-octeon/dma-octeon.c b/arch/mips/cavium-octeon/dma-octeon.c
index fd69528b24fb..1226965e1e4f 100644
--- a/arch/mips/cavium-octeon/dma-octeon.c
+++ b/arch/mips/cavium-octeon/dma-octeon.c
@@ -164,19 +164,14 @@ static void *octeon_dma_alloc_coherent(struct device *dev, size_t size,
 	/* ignore region specifiers */
 	gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM);
 
-#ifdef CONFIG_ZONE_DMA
-	if (dev == NULL)
+	if (IS_ENABLED(CONFIG_ZONE_DMA) && dev == NULL)
 		gfp |= __GFP_DMA;
-	else if (dev->coherent_dma_mask <= DMA_BIT_MASK(24))
+	else if (IS_ENABLED(CONFIG_ZONE_DMA) &&
+		 dev->coherent_dma_mask <= DMA_BIT_MASK(24))
 		gfp |= __GFP_DMA;
-	else
-#endif
-#ifdef CONFIG_ZONE_DMA32
-	     if (dev->coherent_dma_mask <= DMA_BIT_MASK(32))
+	else if (IS_ENABLED(CONFIG_ZONE_DMA32) &&
+		 dev->coherent_dma_mask <= DMA_BIT_MASK(32))
 		gfp |= __GFP_DMA32;
-	else
-#endif
-		;
 
 	/* Don't invoke OOM killer */
 	gfp |= __GFP_NORETRY;
-- 
2.9.0

  parent reply	other threads:[~2017-01-17 15:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-17 15:18 [PATCH 01/13] MIPS: fix modversions Arnd Bergmann
2017-01-17 15:18 ` [PATCH 02/13] MIPS: VDSO: avoid duplicate CAC_BASE definition Arnd Bergmann
2017-01-17 15:18 ` [PATCH 03/13] MIPS: 'make -s' should be silent Arnd Bergmann
2017-01-17 15:18 ` [PATCH 04/13] MIPS: zboot: fix 'make clean' failure Arnd Bergmann
2017-01-18  9:43   ` Sergei Shtylyov
2017-01-18  9:48     ` Arnd Bergmann
2017-01-17 15:18 ` [PATCH 05/13] MIPS: alchemy: remove duplicate initializer Arnd Bergmann
2017-01-17 15:18 ` [PATCH 06/13] MIPS: Lantiq: Fix another request_mem_region() return code check Arnd Bergmann
2017-01-17 15:18 ` [PATCH 07/13] MIPS: ralink: remove unused timer functions Arnd Bergmann
2017-01-17 15:18 ` [PATCH 08/13] MIPS: ralink: fix request_mem_region error handling Arnd Bergmann
2017-01-17 15:18 ` [PATCH 09/13] MIPS: ralink: remove unused rt*_wdt_reset functions Arnd Bergmann
2017-01-17 15:18 ` [PATCH 10/13] MIPS: loongson64: fix empty-body warning in dma_alloc Arnd Bergmann
2017-01-17 15:18 ` Arnd Bergmann [this message]
2017-01-17 20:00   ` [PATCH 11/13] MIPS: octeon: avoid empty-body warning David Daney
2017-01-17 20:00     ` David Daney
2017-01-17 15:18 ` [PATCH 12/13] MIPS: ip22: fix ip28 build for modern gcc Arnd Bergmann
2017-01-17 15:18 ` [PATCH 13/13] MIPS: avoid old-style declaration Arnd Bergmann

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=20170117151911.4109452-11-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=egtvedt@samfundet.no \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=vgupta@synopsys.com \
    /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).