mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Andre Przywara <andre.przywara@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, will.deacon@arm.com,
	catalin.marinas@arm.com,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm: dma-mapping: fix build warning with new DMA_ERROR_CODE definition
Date: Mon, 14 Sep 2015 17:31:55 +0100	[thread overview]
Message-ID: <20150914163155.GO21084@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1442247198-12435-1-git-send-email-andre.przywara@arm.com>

On Mon, Sep 14, 2015 at 05:13:18PM +0100, Andre Przywara wrote:
> Commit 96231b2686b5: ("ARM: 8419/1: dma-mapping: harmonize definition
> of DMA_ERROR_CODE") changed the definition of DMA_ERROR_CODE to use
> dma_addr_t, which makes the compiler barf on assigning this to an
> "int" variable on ARM with LPAE enabled:
> -------------------
> In file included from /src/linux/include/linux/dma-mapping.h:86:0,
>                  from /src/linux/arch/arm/mm/dma-mapping.c:21:
> /src/linux/arch/arm/mm/dma-mapping.c: In function '__iommu_create_mapping':
> /src/linux/arch/arm/include/asm/dma-mapping.h:16:24: warning:
> overflow in implicit constant conversion [-Woverflow]
>  #define DMA_ERROR_CODE (~(dma_addr_t)0x0)
>                         ^
> /src/linux/arch/arm/mm/dma-mapping.c:1252:15: note: in expansion of
> macro DMA_ERROR_CODE'
>   int i, ret = DMA_ERROR_CODE;
>                ^

It's absolutely right to barf on this.  DMA_ERROR_CODE is _supposed_
to be a dma_addr_t cookie.  It isn't an int.

> Remove the actually unneeded initialization of "ret" in
> __iommu_create_mapping() and move the variable declaration inside the
> for-loop to make the scope of this variable more clear.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>  arch/arm/mm/dma-mapping.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> Hi Russell,
> 
> I hope that hasn't turned up before, but this triggers with my config.
> Please apply for 4.3.

The patch looks correct, please put it in the patch system, thanks.

-- 
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

      reply	other threads:[~2015-09-14 16:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-14 16:13 Andre Przywara
2015-09-14 16:31 ` Russell King - ARM Linux [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=20150914163155.GO21084@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=andre.przywara@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=will.deacon@arm.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

all inboxes | Powered by JetHome®