On Fri, Nov 27, 2026 at 3:41 AM Baran Tuna <[email protected]> wrote:
>
> Replace the open-coded enable ? "enable" : "disable" ternary with
> the str_enable_disable() helper from <linux/string_choices.h>.

I personally find these helpers to make the code less clear and they
still take just about as much space to type out.

Alex

>
> Found by scripts/coccinelle/api/string_choices.cocci.
>
> Signed-off-by: Baran Tuna <[email protected]>
> ---
> Compile-tested only.
>
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 5d1b010bec9b..870b4653314f 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -85,6 +85,7 @@
>  #include <linux/firmware.h>
>  #include <linux/component.h>
>  #include <linux/sort.h>
> +#include <linux/string_choices.h>
>
>  #include <drm/drm_privacy_screen_consumer.h>
>  #include <drm/display/drm_dp_mst_helper.h>
> @@ -1468,7 +1469,7 @@ STATIC_IFN_KUNIT void 
> dm_gpureset_toggle_interrupts(struct amdgpu_device *adev,
>                         rc = amdgpu_dm_irq_set(adev, irq_source, enable) ? 0 
> : -EBUSY;
>                         if (rc)
>                                 drm_warn(adev_to_drm(adev), "Failed to %s 
> pflip interrupts\n",
> -                                        enable ? "enable" : "disable");
> +                                        str_enable_disable(enable));
>
>                         if (dc_supports_vrr(adev->dm.dc->ctx->dce_version)) {
>                                 if (enable) {
>
> base-commit: 25faec9ce61c01fb45abf812a222c5b43c3cd5c5
> --
> 2.53.0
>

Reply via email to