drm/amdgpu: use string choice helpers
Subsystems (2)
PATCH 1/1 drm/amdgpu: use string choice helpers
Use string choice helpers for better readability.
---
Reported in linux repository.
cocci warnings: (new ones prefixed by >>)
Quoted 1 line
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c:311:49-70: opportunity for
str_true_false(vpe -> collaborate_mode)
vim +311 drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
for linux-next:
drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c +1 -1
@@ -317,7 +317,7 @@ static int vpe_early_init(struct amdgpu_ip_block *ip_block)vpe_set_ring_funcs (adev);vpe_set_regs (vpe); -dev_info (adev->dev,"VPE: collaborate mode %s" , vpe->collaborate_mode ?"true" :"false" ); +dev_info (adev->dev,"VPE: collaborate mode %s" ,str_true_false (vpe->collaborate_mode));return 0 ; }
Signature · 1 line
2.34.1
Quoted 26 lines · R Sundar
Use string choice helpers for better readability.
Reported-by kernel test robot <[email protected]>Reported-by Julia Lawall <[email protected]>Signed-off-by R Sundar <[email protected]>---
Reported in linux repository.
cocci warnings: (new ones prefixed by >>)
Quoted 1 line
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c:311:49-70: opportunity for
str_true_false(vpe -> collaborate_mode)vim +311
drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.cfor linux-next:
drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c static int vpe_early_init(struct amdgpu_ip_block *ip_block) · line 320
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c +1
-1@@ -317,7 +317,7 @@ static int vpe_early_init(struct amdgpu_ip_block *ip_block)vpe_set_ring_funcs (adev);vpe_set_regs (vpe); -dev_info (adev->dev,"VPE: collaborate mode %s" , vpe->collaborate_mode ?"true" :"false" ); +dev_info (adev->dev,"VPE: collaborate mode %s" ,str_true_false (vpe->collaborate_mode));
I'm not opposed to this change if there is a general initiative to convert everyone over to using this for some useful reason, but I personally don't think it helps readability at all. If anything it makes it worse in my opinion.
Alex
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c +0
-1return 0 ; } --2.34.1