]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/amdkfd: Change svm_range_get_info return type
authorAndrey Vatoropin <a.vatoropin@crpt.ru>
Wed, 2 Apr 2025 14:12:25 +0000 (14:12 +0000)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 22 May 2025 16:00:30 +0000 (12:00 -0400)
commiteed6a6b2264078806163424b7cb70a3b47cb8e97
treeccd1eb778606912765a254f4bc43fd8614cfa945
parentc4f8ac095fc91084108ec21117eb9c1fff64725d
drm/amdkfd: Change svm_range_get_info return type

Static analysis shows that pointer "svms" cannot be NULL because it points
to the object "struct svm_range_list". Remove the extra NULL check. It is
meaningless and harms the readability of the code.

In the function svm_range_get_info() there is no possibility of failure.
Therefore, the caller of the function svm_range_get_info() does not need
a return value. Change the function svm_range_get_info() return type from
"int" to "void".

Since the function svm_range_get_info() has a return type of "void". The
caller of the function svm_range_get_info() does not need a return value.
Delete extra code.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Andrey Vatoropin <a.vatoropin@crpt.ru>
Signed-off-by: Felix Kuehling <felix.kuehling@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
drivers/gpu/drm/amd/amdkfd/kfd_svm.c
drivers/gpu/drm/amd/amdkfd/kfd_svm.h