Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1213159 > unrolled thread

[PATCH -next] MIPS: Netlogic: Fix build error

Started byGuenter Roeck <linux@roeck-us.net>
First post2015-08-25 18:30 +0200
Last post2015-08-25 19:20 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH -next] MIPS: Netlogic: Fix build error Guenter Roeck <linux@roeck-us.net> - 2015-08-25 18:30 +0200
    Re: [PATCH -next] MIPS: Netlogic: Fix build error Guenter Roeck <linux@roeck-us.net> - 2015-08-25 19:20 +0200

#1213159 — [PATCH -next] MIPS: Netlogic: Fix build error

FromGuenter Roeck <linux@roeck-us.net>
Date2015-08-25 18:30 +0200
Subject[PATCH -next] MIPS: Netlogic: Fix build error
Message-ID<q1pgK-3rY-11@gated-at.bofh.it>
dma_alloc_from_coherent is defined as (0) if HAVE_GENERIC_DMA_COHERENT
is not configured. This results in the following build error, seen
with nlm_xlp_defconfig.

arch/mips/netlogic/common/nlm-dma.c: In function 'nlm_dma_alloc_coherent':
arch/mips/netlogic/common/nlm-dma.c:50:8: error: unused variable 'ret'

Add __maybe_unused to the variable declaration to fix the problem.

Fixes: 79f8511c83f1 ("MIPS: Netlogic: SWIOTLB dma ops for 32-bit DMA")
Cc: Jayachandran C <jchandra@broadcom.com>
Cc: Ganesan Ramalingam <ganesanr@broadcom.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 arch/mips/netlogic/common/nlm-dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/netlogic/common/nlm-dma.c b/arch/mips/netlogic/common/nlm-dma.c
index f3d4ae87abc7..4982d97d279f 100644
--- a/arch/mips/netlogic/common/nlm-dma.c
+++ b/arch/mips/netlogic/common/nlm-dma.c
@@ -47,7 +47,7 @@ static char *nlm_swiotlb;
 static void *nlm_dma_alloc_coherent(struct device *dev, size_t size,
 	dma_addr_t *dma_handle, gfp_t gfp, struct dma_attrs *attrs)
 {
-	void *ret;
+	void __maybe_unused *ret;
 
 	if (dma_alloc_from_coherent(dev, size, dma_handle, &ret))
 		return ret;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1213192

FromGuenter Roeck <linux@roeck-us.net>
Date2015-08-25 19:20 +0200
Message-ID<q1q38-4BB-5@gated-at.bofh.it>
In reply to#1213159
On 08/25/2015 09:29 AM, Guenter Roeck wrote:
> dma_alloc_from_coherent is defined as (0) if HAVE_GENERIC_DMA_COHERENT
> is not configured. This results in the following build error, seen
> with nlm_xlp_defconfig.
>
> arch/mips/netlogic/common/nlm-dma.c: In function 'nlm_dma_alloc_coherent':
> arch/mips/netlogic/common/nlm-dma.c:50:8: error: unused variable 'ret'
>
> Add __maybe_unused to the variable declaration to fix the problem.
>
> Fixes: 79f8511c83f1 ("MIPS: Netlogic: SWIOTLB dma ops for 32-bit DMA")

Upon reflection, I think the problem may have been introduced by changes
in the definition of dma_alloc_from_coherent(), not by the above patch.
Not sure how to fix that properly.

Guenter

> Cc: Jayachandran C <jchandra@broadcom.com>
> Cc: Ganesan Ramalingam <ganesanr@broadcom.com>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
>   arch/mips/netlogic/common/nlm-dma.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/mips/netlogic/common/nlm-dma.c b/arch/mips/netlogic/common/nlm-dma.c
> index f3d4ae87abc7..4982d97d279f 100644
> --- a/arch/mips/netlogic/common/nlm-dma.c
> +++ b/arch/mips/netlogic/common/nlm-dma.c
> @@ -47,7 +47,7 @@ static char *nlm_swiotlb;
>   static void *nlm_dma_alloc_coherent(struct device *dev, size_t size,
>   	dma_addr_t *dma_handle, gfp_t gfp, struct dma_attrs *attrs)
>   {
> -	void *ret;
> +	void __maybe_unused *ret;
>
>   	if (dma_alloc_from_coherent(dev, size, dma_handle, &ret))
>   		return ret;
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web