RE: [PATCH 15/22] drm/amd/pm: fix enum feature compared against 0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[AMD Official Use Only - General]

This patch is,

Reviewed-by: Tim Huang <Tim.Huang@xxxxxxx>



> -----Original Message-----
> From: Jesse Zhang <jesse.zhang@xxxxxxx>
> Sent: Friday, May 10, 2024 10:51 AM
> To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> Cc: Deucher, Alexander <Alexander.Deucher@xxxxxxx>; Koenig, Christian
> <Christian.Koenig@xxxxxxx>; Huang, Tim <Tim.Huang@xxxxxxx>; Zhang,
> Jesse(Jie) <Jesse.Zhang@xxxxxxx>; Zhang, Jesse(Jie)
> <Jesse.Zhang@xxxxxxx>
> Subject: [PATCH 15/22] drm/amd/pm: fix enum feature compared against 0
>
> This less-than-zero comparison of an unsigned value is never true. feature <
> 0U
>
> Signed-off-by: Jesse Zhang <Jesse.Zhang@xxxxxxx>
> ---
>  drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
> b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
> index 6d1c3af927ca..d439b95bfb79 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
> @@ -760,7 +760,7 @@ static const char *__smu_feature_names[] =
> {  static const char *smu_get_feature_name(struct smu_context *smu,
>                                       enum smu_feature_mask feature)
>  {
> -     if (feature < 0 || feature >= SMU_FEATURE_COUNT)
> +     if (feature >= SMU_FEATURE_COUNT)
>               return "unknown smu feature";
>       return __smu_feature_names[feature];
>  }
> --
> 2.25.1





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux