Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: Fix 32bit x86 compilation warning

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]

v2: Add a space between "&" and "0xff"

Reported by: kbuild-all@01.org

Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Alex Xie and committed by
Alex Deucher
60508d3d c7217b2a

+3 -3
+1 -1
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
··· 172 172 (u32)(adev->dummy_page.addr >> 12)); 173 173 WREG32(SOC15_REG_OFFSET(GC, 0, 174 174 mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32), 175 - (u32)(adev->dummy_page.addr >> 44)); 175 + (u32)((u64)adev->dummy_page.addr >> 44)); 176 176 177 177 tmp = RREG32(SOC15_REG_OFFSET(GC, 0, mmVM_L2_PROTECTION_FAULT_CNTL2)); 178 178 tmp = REG_SET_FIELD(tmp, VM_L2_PROTECTION_FAULT_CNTL2,
+1 -1
drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
··· 186 186 (u32)(adev->dummy_page.addr >> 12)); 187 187 WREG32(SOC15_REG_OFFSET(MMHUB, 0, 188 188 mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32), 189 - (u32)(adev->dummy_page.addr >> 44)); 189 + (u32)((u64)adev->dummy_page.addr >> 44)); 190 190 191 191 tmp = RREG32(SOC15_REG_OFFSET(MMHUB, 0, mmVM_L2_PROTECTION_FAULT_CNTL2)); 192 192 tmp = REG_SET_FIELD(tmp, VM_L2_PROTECTION_FAULT_CNTL2,
+1 -1
drivers/gpu/drm/amd/amdgpu/vega10_ih.c
··· 103 103 /* Ring Buffer base. [39:8] of 40-bit address of the beginning of the ring buffer*/ 104 104 if (adev->irq.ih.use_bus_addr) { 105 105 WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE), adev->irq.ih.rb_dma_addr >> 8); 106 - WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE_HI), (adev->irq.ih.rb_dma_addr >> 40) &0xff); 106 + WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE_HI), ((u64)adev->irq.ih.rb_dma_addr >> 40) & 0xff); 107 107 ih_rb_cntl = REG_SET_FIELD(ih_rb_cntl, IH_RB_CNTL, MC_SPACE, 1); 108 108 } else { 109 109 WREG32(SOC15_REG_OFFSET(OSSSYS, 0, mmIH_RB_BASE), adev->irq.ih.gpu_addr >> 8);