[PATCH linux-next] drm/amdgpu: use string choice helpers

Alex Deucher alexdeucher at gmail.com
Mon Apr 28 17:24:10 UTC 2025


On Sun, Apr 27, 2025 at 5:46 AM R Sundar <prosunofficial at gmail.com> wrote:
>
> Use string choice helpers for better readability.
>
> Reported-by: kernel test robot <lkp at intel.com>
> Reported-by: Julia Lawall <julia.lawall at inria.fr>
> Closes: https://lore.kernel.org/r/202503222049.sUXL3q6w-lkp@intel.com/
> Signed-off-by: R Sundar <prosunofficial at gmail.com>
> ---
>
> Reported in linux repository.
>
> cocci warnings: (new ones prefixed by >>)
> >> 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(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
> index 121ee17b522b..442d137e0fed 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
> @@ -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

>
>         return 0;
>  }
> --
> 2.34.1
>


More information about the amd-gfx mailing list