drm/amd/pm: fix enum feature compared against 0
authorJesse Zhang <jesse.zhang@amd.com>
Thu, 9 May 2024 03:09:37 +0000 (11:09 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 13 May 2024 20:12:02 +0000 (16:12 -0400)
This less-than-zero comparison of an unsigned value is never true. feature < 0U

Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Tim Huang <Tim.Huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c

index ac17e44ba85b8488941a0abb7b3ce2cb6bbd2fe2..602aa694123102346071c874d3d0fd8f5bb9c0d8 100644 (file)
@@ -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];
 }