[Public]

> -----Original Message-----
> From: [email protected] <[email protected]>
> Sent: Friday, June 20, 2025 11:26 PM
> To: Deucher, Alexander <[email protected]>
> Cc: Koenig, Christian <[email protected]>; [email protected];
> [email protected]; Zhang, Hawking <[email protected]>; Wang,
> Yang(Kevin) <[email protected]>; Liu, Xiang(Dean)
> <[email protected]>; Zhou1, Tao <[email protected]>; [email protected];
> [email protected]; [email protected]; dri-
> [email protected]; [email protected]; 
> [email protected];
> [email protected]; [email protected]
> Subject: [PATCH] drm/amdgpu: Use str_on_off() helper
>
> From: Yumeng Fang <[email protected]>
>
> Remove hard-coded strings by using the str_on_off() helper.

I personally find that these helpers hurt readability.

Alex

>
> Signed-off-by: Yumeng Fang <[email protected]>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c | 3 ++-
> drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c | 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c
> index cbc40cad581b..c3c88d8e1ce2 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c
> @@ -22,6 +22,7 @@
>   */
>
>  #include <linux/list.h>
> +#include <linux/string_choices.h>
>  #include "amdgpu.h"
>  #include "amdgpu_aca.h"
>  #include "amdgpu_ras.h"
> @@ -873,7 +874,7 @@ static int amdgpu_aca_smu_debug_mode_set(void *data,
> u64 val)
>       if (ret)
>               return ret;
>
> -     dev_info(adev->dev, "amdgpu set smu aca debug mode %s success\n", val
> ? "on" : "off");
> +     dev_info(adev->dev, "amdgpu set smu aca debug mode %s success\n",
> +str_on_off(val));
>
>       return 0;
>  }
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c
> index 3ca03b5e0f91..81dcc7ebac3b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c
> @@ -20,6 +20,7 @@
>   * OTHER DEALINGS IN THE SOFTWARE.
>   *
>   */
> +#include <linux/string_choices.h>
>  #include "amdgpu_ras.h"
>  #include "amdgpu.h"
>  #include "amdgpu_mca.h"
> @@ -519,7 +520,7 @@ static int amdgpu_mca_smu_debug_mode_set(void *data,
> u64 val)
>       if (ret)
>               return ret;
>
> -     dev_info(adev->dev, "amdgpu set smu mca debug mode %s success\n", val
> ? "on" : "off");
> +     dev_info(adev->dev, "amdgpu set smu mca debug mode %s success\n",
> +str_on_off(val));
>
>       return 0;
>  }
> --
> 2.25.1

Reply via email to