drm/amd/pm: fix enum type compared against 0
authorJesse Zhang <jesse.zhang@amd.com>
Thu, 9 May 2024 03:20:57 +0000 (11:20 +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. type < 0U

Signed-off-by: Jesse Zhang <Jesse.Zhang@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 6d1c3af..ac17e44 100644 (file)
@@ -56,7 +56,7 @@ static const char * const __smu_message_names[] = {
 static const char *smu_get_message_name(struct smu_context *smu,
                                        enum smu_message_type type)
 {
-       if (type < 0 || type >= SMU_MSG_MAX_COUNT)
+       if (type >= SMU_MSG_MAX_COUNT)
                return "unknown smu message";
 
        return __smu_message_names[type];