]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amdgpu: Use explicit VCN instance 0 in SR-IOV init
authorSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Thu, 18 Dec 2025 09:55:25 +0000 (15:25 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 5 Jan 2026 21:59:56 +0000 (16:59 -0500)
commitaf26fa751c2eef66916acbf0d3c3e9159da56186
tree5f3cfe04a7f3508d2c07573e3b94d42095db729b
parent56c0a9c33cfd9c8035737746b7263266c230b80a
drm/amdgpu: Use explicit VCN instance 0 in SR-IOV init

vcn_v2_0_start_sriov() declares a local variable "i" initialized to zero
and uses it only as the instance index in SOC15_REG_OFFSET(UVD, i, ...).
The value is never changed and all other fields are taken from
adev->vcn.inst[0], so this path only ever programs VCN instance 0.

This triggered a Smatch:
warn: iterator 'i' not incremented

Replace the dummy iterator with an explicit instance index of 0 in
SOC15_REG_OFFSET() calls.

Fixes: dd26858a9cd8 ("drm/amdgpu: implement initialization part on VCN2.0 for SRIOV")
Reported by: Dan Carpenter <dan.carpenter@linaro.org>
Cc: darlington Opara <darlington.opara@amd.com>
Cc: Jinage Zhao <jiange.zhao@amd.com>
Cc: Monk Liu <Monk.Liu@amd.com>
Cc: Emily Deng <Emily.Deng@amd.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: Emily Deng <Emily.Deng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c