All of lore.kernel.org
 help / color / mirror / Atom feed
From: m.szyprowski@samsung.com (Marek Szyprowski)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm: dma-mapping: fix compilation error when CONFIG_MMU is not present
Date: Mon, 20 Oct 2014 09:42:55 +0200	[thread overview]
Message-ID: <5444BCFF.8030803@samsung.com> (raw)
In-Reply-To: <1413734340-53108-1-git-send-email-stefan.hengelein@fau.de>

Hello,

On 2014-10-19 17:59, Stefan Hengelein wrote:
> When CONFIG_MMU is not present, the variable 'atomic_pool' and the
> function '__in_atomic_pool' are undeclared but used in part of the
> code. Therefore, the compilation breaks.
> Now, they are defined to dummy values when CONFIG_MMU is undefined.
>
> This error was found with vampyr.

Frankly, those variables are used only when CONFIG_MMU or
CONFIG_ARM_DMA_USE_IOMMU are set. The latter imho makes only sense
together with CONFIG_MMU, so the issue reported here doesn't really
happen in real world.

> Signed-off-by: Stefan Hengelein <stefan.hengelein@fau.de>
> ---
>   arch/arm/mm/dma-mapping.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
> index c245d90..7d04cf7 100644
> --- a/arch/arm/mm/dma-mapping.c
> +++ b/arch/arm/mm/dma-mapping.c
> @@ -573,12 +573,14 @@ static inline pgprot_t __get_dma_pgprot(struct dma_attrs *attrs, pgprot_t prot)
>   #else	/* !CONFIG_MMU */
>   
>   #define nommu() 1
> +#define atomic_pool 0
>   
>   #define __get_dma_pgprot(attrs, prot)	__pgprot(0)
>   #define __alloc_remap_buffer(dev, size, gfp, prot, ret, c)	NULL
>   #define __alloc_from_pool(size, ret_page)			NULL
>   #define __alloc_from_contiguous(dev, size, prot, ret, c)	NULL
>   #define __free_from_pool(cpu_addr, size)			0
> +#define __in_atomic_pool(start, size)				0
>   #define __free_from_contiguous(dev, page, cpu_addr, size)	do { } while (0)
>   #define __dma_free_remap(cpu_addr, size)			do { } while (0)
>   

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

WARNING: multiple messages have this Message-ID (diff)
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Stefan Hengelein <stefan.hengelein@fau.de>, linux-kernel@vger.kernel.org
Cc: linux@arm.linux.org.uk, akpm@linux-foundation.org,
	lauraa@codeaurora.org, linux-arm-kernel@lists.infradead.org,
	andreas.herrmann@calxeda.com
Subject: Re: [PATCH] arm: dma-mapping: fix compilation error when CONFIG_MMU is not present
Date: Mon, 20 Oct 2014 09:42:55 +0200	[thread overview]
Message-ID: <5444BCFF.8030803@samsung.com> (raw)
In-Reply-To: <1413734340-53108-1-git-send-email-stefan.hengelein@fau.de>

Hello,

On 2014-10-19 17:59, Stefan Hengelein wrote:
> When CONFIG_MMU is not present, the variable 'atomic_pool' and the
> function '__in_atomic_pool' are undeclared but used in part of the
> code. Therefore, the compilation breaks.
> Now, they are defined to dummy values when CONFIG_MMU is undefined.
>
> This error was found with vampyr.

Frankly, those variables are used only when CONFIG_MMU or
CONFIG_ARM_DMA_USE_IOMMU are set. The latter imho makes only sense
together with CONFIG_MMU, so the issue reported here doesn't really
happen in real world.

> Signed-off-by: Stefan Hengelein <stefan.hengelein@fau.de>
> ---
>   arch/arm/mm/dma-mapping.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
> index c245d90..7d04cf7 100644
> --- a/arch/arm/mm/dma-mapping.c
> +++ b/arch/arm/mm/dma-mapping.c
> @@ -573,12 +573,14 @@ static inline pgprot_t __get_dma_pgprot(struct dma_attrs *attrs, pgprot_t prot)
>   #else	/* !CONFIG_MMU */
>   
>   #define nommu() 1
> +#define atomic_pool 0
>   
>   #define __get_dma_pgprot(attrs, prot)	__pgprot(0)
>   #define __alloc_remap_buffer(dev, size, gfp, prot, ret, c)	NULL
>   #define __alloc_from_pool(size, ret_page)			NULL
>   #define __alloc_from_contiguous(dev, size, prot, ret, c)	NULL
>   #define __free_from_pool(cpu_addr, size)			0
> +#define __in_atomic_pool(start, size)				0
>   #define __free_from_contiguous(dev, page, cpu_addr, size)	do { } while (0)
>   #define __dma_free_remap(cpu_addr, size)			do { } while (0)
>   

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


  reply	other threads:[~2014-10-20  7:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-19 15:59 [PATCH] arm: dma-mapping: fix compilation error when CONFIG_MMU is not present Stefan Hengelein
2014-10-19 15:59 ` Stefan Hengelein
2014-10-20  7:42 ` Marek Szyprowski [this message]
2014-10-20  7:42   ` Marek Szyprowski
2014-10-20 13:50   ` Stefan Hengelein
2014-10-21  0:05     ` Laura Abbott
2014-10-21  0:05       ` Laura Abbott
     [not found]       ` <5445A345.7010401-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2014-10-23  8:15         ` Marek Szyprowski
2014-10-23  8:15           ` Marek Szyprowski
2014-10-23  8:15           ` Marek Szyprowski
2014-10-24 13:15           ` Stefan Hengelein
2014-10-24 13:15             ` Stefan Hengelein
     [not found]             ` <CABv5NL_E83CgBcHbAqo9xejWAEamO3oxX6ZjU+fo9X6k4cE_1w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-27 11:59               ` Marek Szyprowski
2014-10-27 11:59                 ` Marek Szyprowski
2014-10-27 11:59                 ` Marek Szyprowski

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=5444BCFF.8030803@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.