提交 62e389d7 编写于 作者: A Arnd Bergmann 提交者: Zheng Zengkai

amdgpu: avoid incorrect %hu format string

stable inclusion
from stable-5.10.36
commit f26f33a40952a7d6a5ec7a361d495a1163d3aba1
bugzilla: 51867
CVE: NA

--------------------------------

[ Upstream commit 7d98d416 ]

clang points out that the %hu format string does not match the type
of the variables here:

drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:263:7: warning: format specifies type 'unsigned short' but the argument has type 'unsigned int' [-Wformat]
                                  version_major, version_minor);
                                  ^~~~~~~~~~~~~
include/drm/drm_print.h:498:19: note: expanded from macro 'DRM_ERROR'
        __drm_err(fmt, ##__VA_ARGS__)
                  ~~~    ^~~~~~~~~~~

Change it to a regular %u, the same way a previous patch did for
another instance of the same warning.
Reviewed-by: NChristian König <christian.koenig@amd.com>
Reviewed-by: NTom Rix <trix@redhat.com>
Signed-off-by: NArnd Bergmann <arnd@arndb.de>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 0b730a7a
...@@ -259,7 +259,7 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev) ...@@ -259,7 +259,7 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev)
if ((adev->asic_type == CHIP_POLARIS10 || if ((adev->asic_type == CHIP_POLARIS10 ||
adev->asic_type == CHIP_POLARIS11) && adev->asic_type == CHIP_POLARIS11) &&
(adev->uvd.fw_version < FW_1_66_16)) (adev->uvd.fw_version < FW_1_66_16))
DRM_ERROR("POLARIS10/11 UVD firmware version %hu.%hu is too old.\n", DRM_ERROR("POLARIS10/11 UVD firmware version %u.%u is too old.\n",
version_major, version_minor); version_major, version_minor);
} else { } else {
unsigned int enc_major, enc_minor, dec_minor; unsigned int enc_major, enc_minor, dec_minor;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册