]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amdgpu: fix bit shift logic
authorSathishkumar S <sathishkumar.sundararaju@amd.com>
Fri, 10 Oct 2025 18:02:40 +0000 (23:32 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 13 Oct 2025 18:14:15 +0000 (14:14 -0400)
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>
drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c

index 6b7d66b6d4cc48b06fa805fd01788152395cb9dd..63ee6ba6a9316d105b1cdec0e7d959e8ba9dc785 100644 (file)
@@ -371,7 +371,7 @@ static int amdgpu_debugfs_jpeg_sched_mask_set(void *data, u64 val)
        for (i = 0; i < adev->jpeg.num_jpeg_inst; ++i) {
                for (j = 0; j < adev->jpeg.num_jpeg_rings; ++j) {
                        ring = &adev->jpeg.inst[i].ring_dec[j];
-                       if (val & (BIT_ULL(1) << ((i * adev->jpeg.num_jpeg_rings) + j)))
+                       if (val & (BIT_ULL((i * adev->jpeg.num_jpeg_rings) + j)))
                                ring->sched.ready = true;
                        else
                                ring->sched.ready = false;