All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhang, Jerry (Junwei)" <Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
To: Alex Xie <AlexBin.Xie-5C7GfCeVMHo@public.gmane.org>,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH] drm/amdgpu: Fix 32bit x86 compilation warning
Date: Wed, 29 Mar 2017 09:50:27 +0800	[thread overview]
Message-ID: <58DB12E3.3060308@amd.com> (raw)
In-Reply-To: <1490726220-29149-1-git-send-email-AlexBin.Xie-5C7GfCeVMHo@public.gmane.org>


On 03/29/2017 02:37 AM, Alex Xie wrote:
> drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c:187:2: warning: right shift count >= width of type [enabled by default]
> drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c:173:2: warning: right shift count >= width of type [enabled by default]
> drivers/gpu/drm/amd/amdgpu/vega10_ih.c:106:3: warning: right shift count >= width of type [enabled by default]
>
> Reported by: kbuild-all@01.org
>
> Change-Id: I0c3e52f7fd1026d07ac1042b5e8796fbdf09afff
> Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 2 +-
>   drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c  | 2 +-
>   drivers/gpu/drm/amd/amdgpu/vega10_ih.c   | 2 +-
>   3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
> index 5604a53..5d4d999 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
> @@ -172,7 +172,7 @@ int gfxhub_v1_0_gart_enable(struct amdgpu_device *adev)
>   		(u32)(adev->dummy_page.addr >> 12));
>   	WREG32(SOC15_REG_OFFSET(GC, 0,
>   				mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32),
> -		(u32)(adev->dummy_page.addr >> 44));
> +		(u32)((u64)adev->dummy_page.addr >> 44));
>
>   	tmp = RREG32(SOC15_REG_OFFSET(GC, 0, mmVM_L2_PROTECTION_FAULT_CNTL2));
>   	tmp = REG_SET_FIELD(tmp, VM_L2_PROTECTION_FAULT_CNTL2,
> diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
> index 5903bb0..d41e765 100644
> --- a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
> @@ -186,7 +186,7 @@ int mmhub_v1_0_gart_enable(struct amdgpu_device *adev)
>   		(u32)(adev->dummy_page.addr >> 12));
>   	WREG32(SOC15_REG_OFFSET(MMHUB, 0,
>   				mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32),
> -		(u32)(adev->dummy_page.addr >> 44));
> +		(u32)((u64)adev->dummy_page.addr >> 44));
>
>   	tmp = RREG32(SOC15_REG_OFFSET(MMHUB, 0, mmVM_L2_PROTECTION_FAULT_CNTL2));
>   	tmp = REG_SET_FIELD(tmp, VM_L2_PROTECTION_FAULT_CNTL2,
> diff --git a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
> index 23371e1..041ed0b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
> @@ -103,7 +103,7 @@ static int vega10_ih_irq_init(struct amdgpu_device *adev)
>   	/* Ring Buffer base. [39:8] of 40-bit address of the beginning of the ring buffer*/
>   	if (adev->irq.ih.use_bus_addr) {
>   		WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE), adev->irq.ih.rb_dma_addr >> 8);
> -		WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE_HI), (adev->irq.ih.rb_dma_addr >> 40) &0xff);
> +		WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE_HI), ((u64)adev->irq.ih.rb_dma_addr >> 40) &0xff);
Could you adding a space between "&" and "0xff" during this fix?

>   		ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, MC_SPACE, 1);
>   	} else {
>   		WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE), adev->irq.ih.gpu_addr >> 8);

Maybe miss the "else" case, like below:
   WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE_HI), (adev->irq.ih.gpu_addr 
 >> 40) & 0xff);

Jerry

>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2017-03-29  1:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-28 18:37 [PATCH] drm/amdgpu: Fix 32bit x86 compilation warning Alex Xie
     [not found] ` <1490726220-29149-1-git-send-email-AlexBin.Xie-5C7GfCeVMHo@public.gmane.org>
2017-03-28 20:22   ` Deucher, Alexander
2017-03-29  1:50   ` Zhang, Jerry (Junwei) [this message]
     [not found]     ` <58DB12E3.3060308-5C7GfCeVMHo@public.gmane.org>
2017-03-29  7:07       ` Christian König
     [not found]         ` <ba3e5a96-e36b-c807-e0fb-84651359a974-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-03-29 13:49           ` Alex Deucher

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=58DB12E3.3060308@amd.com \
    --to=jerry.zhang-5c7gfcevmho@public.gmane.org \
    --cc=AlexBin.Xie-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.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.