RE: [PATCH] drm/amd/pm: Fix warning about helper function use

"Wang, Yang(Kevin)" <[email protected]>
Newsgroups org.freedesktop.lists.amd-gfx
Message-ID <BN9PR12MB5211A0F3EA479CF09F27A70C82C12@BN9PR12MB5211.namprd12.prod.outlook.com>
AMD General

> Fixes: 7b88453a476c ("drm/amd/pm: Change get_enabled_mask signature")
I suggest removing this line and refine the patch title.

The tag "Fixes" is used to indicate that a patch should be cherry-picked to the stable kernel branch as a bugfix.
In this case, this is only a suggestion rather than a bug. No related issue was introduced in the original patch.

Ref:
static inline const char *str_enabled_disabled(bool v)
{
        return v ? "enabled" : "disabled";
}

With that fixed, this patch is
Reviewed-by: Yang Wang <[email protected]>

Best Regards,
Kevin

> -----Original Message-----
> From: Lazar, Lijo <[email protected]>
> Sent: Wednesday, July 22, 2026 14:56
> To: [email protected]
> Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander
> <[email protected]>; Kamal, Asad <[email protected]>; Wang,
> Yang(Kevin) <[email protected]>; kernel test robot <[email protected]>
> Subject: [PATCH] drm/amd/pm: Fix warning about helper function use
>
> Use str_enabled_disabled to fix below warning
> drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c:920:3-56: opportunity for
> str_enabled_disabled(smu_feature_bits_is_set ( & feature_mask , feature_index ))
>
> Fixes: 7b88453a476c ("drm/amd/pm: Change get_enabled_mask signature")
> Reported-by: kernel test robot <[email protected]>
> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
>
> Signed-off-by: Lijo Lazar <[email protected]>
> ---
>  drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
> b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
> index 2bd3ea17e789..764f943df5a8 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
> @@ -965,9 +965,8 @@ size_t smu_cmn_get_pp_feature_mask(struct smu_context
> *smu,
>                       buf, size, "%02d. %-20s (%2d) : %s\n", count++,
>                       smu_get_feature_name(smu, sort_feature[feature_index]),
>                       feature_index,
> -                     smu_feature_bits_is_set(&feature_mask, feature_index) ?
> -                             "enabled" :
> -                             "disabled");
> +                     str_enabled_disabled(smu_feature_bits_is_set(
> +                             &feature_mask, feature_index)));
>       }
>
>       return size;
> --
> 2.49.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.