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

drm/amdgpu: fix bit shift logic

BIT_ULL(n) sets nth bit, remove explicit shift and set the position

Fixes: a7a411e24626 ("drm/amdgpu: fix shift-out-of-bounds in amdgpu_debugfs_jpeg_sched_mask_set")
Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Sathishkumar S and committed by
Alex Deucher
74de0eaa 6917112a

+1 -1
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
··· 371 371 for (i = 0; i < adev->jpeg.num_jpeg_inst; ++i) { 372 372 for (j = 0; j < adev->jpeg.num_jpeg_rings; ++j) { 373 373 ring = &adev->jpeg.inst[i].ring_dec[j]; 374 - if (val & (BIT_ULL(1) << ((i * adev->jpeg.num_jpeg_rings) + j))) 374 + if (val & (BIT_ULL((i * adev->jpeg.num_jpeg_rings) + j))) 375 375 ring->sched.ready = true; 376 376 else 377 377 ring->sched.ready = false;