]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amdgpu: Move amdgpu_vm_is_bo_always_valid() before first use
authorSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Thu, 12 Mar 2026 15:04:48 +0000 (20:34 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 17 Mar 2026 21:47:47 +0000 (17:47 -0400)
commita1c1c77d30cd497ad6dd6062f8a5c06b38a45132
tree1a1641175f366f353fee185f61584b49638044c8
parent9a62a097a7f8d223d722b9e9b557a792d30600ca
drm/amdgpu: Move amdgpu_vm_is_bo_always_valid() before first use

Smatch reports that 'bo' could be NULL in amdgpu_vm_bo_update(), even
though amdgpu_vm_is_bo_always_valid() already checks for a NULL BO.

Move amdgpu_vm_is_bo_always_valid() earlier in the file so the helper
definition appears before its first use. This allows static analysis
tools to see the NULL check performed by the helper and avoids the
warning.

Suggested-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c