Skip to content

Commit

Permalink
MIPS: Octeon: Avoid empty-body warning
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Hans-Christian Noren Egtvedt <[email protected]>
Cc: Vineet Gupta <[email protected]>
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/15048
Signed-off-by: Ralf Baechle <[email protected]>
  • Loading branch information
arndb authored and ralfbaechle committed Jan 25, 2017
1 parent 72d1cfc commit e9663b1
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions arch/mips/cavium-octeon/dma-octeon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e9663b1

Please sign in to comment.