Skip to content

Commit 408d208

Browse files
advait-0alexdeucher
authored andcommitted
drm/amdgpu: Cleanup shift coding style
Improves the coding style by updating bit-shift operations in the amdgpu_jpeg.c driver file. It ensures consistency and avoids potential issues by explicitly using 1U and 1ULL for unsigned and unsigned long long shifts in all relevant instances. Signed-off-by: Advait Dhamorikar <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 92fd171 commit 408d208

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ int amdgpu_jpeg_sw_init(struct amdgpu_device *adev)
4747
adev->jpeg.indirect_sram = true;
4848

4949
for (i = 0; i < adev->jpeg.num_jpeg_inst; i++) {
50-
if (adev->jpeg.harvest_config & (1 << i))
50+
if (adev->jpeg.harvest_config & (1U << i))
5151
continue;
5252

5353
if (adev->jpeg.indirect_sram) {
@@ -73,7 +73,7 @@ int amdgpu_jpeg_sw_fini(struct amdgpu_device *adev)
7373
int i, j;
7474

7575
for (i = 0; i < adev->jpeg.num_jpeg_inst; ++i) {
76-
if (adev->jpeg.harvest_config & (1 << i))
76+
if (adev->jpeg.harvest_config & (1U << i))
7777
continue;
7878

7979
amdgpu_bo_free_kernel(
@@ -110,7 +110,7 @@ static void amdgpu_jpeg_idle_work_handler(struct work_struct *work)
110110
unsigned int i, j;
111111

112112
for (i = 0; i < adev->jpeg.num_jpeg_inst; ++i) {
113-
if (adev->jpeg.harvest_config & (1 << i))
113+
if (adev->jpeg.harvest_config & (1U << i))
114114
continue;
115115

116116
for (j = 0; j < adev->jpeg.num_jpeg_rings; ++j)
@@ -357,7 +357,7 @@ static int amdgpu_debugfs_jpeg_sched_mask_set(void *data, u64 val)
357357
if (!adev)
358358
return -ENODEV;
359359

360-
mask = (1 << (adev->jpeg.num_jpeg_inst * adev->jpeg.num_jpeg_rings)) - 1;
360+
mask = (1ULL << (adev->jpeg.num_jpeg_inst * adev->jpeg.num_jpeg_rings)) - 1;
361361
if ((val & mask) == 0)
362362
return -EINVAL;
363363

@@ -388,7 +388,7 @@ static int amdgpu_debugfs_jpeg_sched_mask_get(void *data, u64 *val)
388388
for (j = 0; j < adev->jpeg.num_jpeg_rings; ++j) {
389389
ring = &adev->jpeg.inst[i].ring_dec[j];
390390
if (ring->sched.ready)
391-
mask |= 1 << ((i * adev->jpeg.num_jpeg_rings) + j);
391+
mask |= 1ULL << ((i * adev->jpeg.num_jpeg_rings) + j);
392392
}
393393
}
394394
*val = mask;

0 commit comments

Comments
 (0)