public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon@arm.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Joerg Roedel <jroedel@suse.de>,
	Mitchel Humpherys <mitchelh@codeaurora.org>,
	"joro@8bytes.org" <joro@8bytes.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"iommu@lists.linux-foundation.org"
	<iommu@lists.linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] iommu: arm-smmu: avoid build warning
Date: Mon, 2 Feb 2015 10:20:49 +0000	[thread overview]
Message-ID: <20150202102048.GB30699@arm.com> (raw)
In-Reply-To: <1754709.y30A9Ie4hF@wuerfel>

On Fri, Jan 30, 2015 at 09:55:55PM +0000, Arnd Bergmann wrote:
> ARM allmodconfig gained a new warning when dma_addr_t is 32-bit wide:
> 
> drivers/iommu/arm-smmu.c: In function 'arm_smmu_iova_to_phys_hard':
> drivers/iommu/arm-smmu.c:1255:3: warning: right shift count >= width of type
> 
> This changes the calculation so that the effective type is always
> 64-bit.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 859a732e4f713 ("iommu/arm-smmu: add support for iova_to_phys through ATS1PR")
> 
> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
> index 1d6d43bb3395..fc13dd56953e 100644
> --- a/drivers/iommu/arm-smmu.c
> +++ b/drivers/iommu/arm-smmu.c
> @@ -1252,7 +1252,7 @@ static phys_addr_t arm_smmu_iova_to_phys_hard(struct iommu_domain *domain,
>  	} else {
>  		u32 reg = iova & ~0xfff;
>  		writel_relaxed(reg, cb_base + ARM_SMMU_CB_ATS1PR_LO);
> -		reg = (iova & ~0xfff) >> 32;
> +		reg = ((u64)iova & ~0xfff) >> 32;
>  		writel_relaxed(reg, cb_base + ARM_SMMU_CB_ATS1PR_HI);
>  	}

Thanks, Arnd.

Acked-by: Will Deacon <will.deacon@arm.com>

Joerg, could you pick this one up directly please? I don't have any other
ARM SMMU fixes queued at the moment.

Will

  reply	other threads:[~2015-02-02 10:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-30 21:55 [PATCH] iommu: arm-smmu: avoid build warning Arnd Bergmann
2015-02-02 10:20 ` Will Deacon [this message]
2015-02-03 17:54   ` joro

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=20150202102048.GB30699@arm.com \
    --to=will.deacon@arm.com \
    --cc=arnd@arndb.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=jroedel@suse.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mitchelh@codeaurora.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox