]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/amd/amdgpu: Fix build errors due to declarations after labels
authorJesse.Zhang <Jesse.Zhang@amd.com>
Mon, 16 Mar 2026 01:40:47 +0000 (09:40 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 17 Mar 2026 14:42:47 +0000 (10:42 -0400)
commit15e19d832bae7921f9c18fd274aa51ee3e75342b
tree8c6def6aa33ba47c379cf3f2f3c2228e7e566c49
parentf802f7b0bc0917023f4b5938246fd7abf23fa5e3
drm/amd/amdgpu: Fix build errors due to declarations after labels

In C90 (which the kernel uses with -std=gnu89), declarations must
appear at the beginning of a block and cannot follow a label. The
switch cases in amdgpu_discovery.c and gmc_v12_1.c contained variable
declarations immediately after case labels, causing the compiler to
error:

drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c:533:3: error: a label can only be
part of a statement and a declaration is not a statement

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c
drivers/gpu/drm/amd/amdkfd/kfd_svm.c