From: Jesse Zhang Date: Thu, 9 May 2024 03:20:57 +0000 (+0800) Subject: drm/amd/pm: fix enum type compared against 0 X-Git-Tag: v6.11-rc1~141^2~25^2~228 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=67024471616e090c994a46630bd23c42d6962a34;p=thirdparty%2Fkernel%2Flinux.git drm/amd/pm: fix enum type compared against 0 This less-than-zero comparison of an unsigned value is never true. type < 0U Signed-off-by: Jesse Zhang Reviewed-by: Tim Huang Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c index 6d1c3af927cac..ac17e44ba85b8 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c @@ -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];