summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdkfd
diff options
context:
space:
mode:
authorJesse.Zhang <Jesse.Zhang@amd.com>2026-03-16 09:40:47 +0800
committerAlex Deucher <alexander.deucher@amd.com>2026-03-17 10:42:47 -0400
commit15e19d832bae7921f9c18fd274aa51ee3e75342b (patch)
tree8c6def6aa33ba47c379cf3f2f3c2228e7e566c49 /drivers/gpu/drm/amd/amdkfd
parentf802f7b0bc0917023f4b5938246fd7abf23fa5e3 (diff)
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>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd')
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_svm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
index 6e833e685dd0..37fdcaf7192f 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
@@ -1220,6 +1220,7 @@ svm_range_get_pte_flags(struct kfd_node *node, struct amdgpu_vm *vm,
bool coherent = flags & (KFD_IOCTL_SVM_FLAG_COHERENT | KFD_IOCTL_SVM_FLAG_EXT_COHERENT);
bool ext_coherent = flags & KFD_IOCTL_SVM_FLAG_EXT_COHERENT;
unsigned int mtype_local, mtype_remote;
+ bool is_aid_a1, is_local;
if (domain == SVM_RANGE_VRAM_DOMAIN)
bo_node = prange->svm_bo->node;
@@ -1307,8 +1308,8 @@ svm_range_get_pte_flags(struct kfd_node *node, struct amdgpu_vm *vm,
mapping_flags |= AMDGPU_VM_MTYPE_NC;
break;
case IP_VERSION(12, 1, 0):
- bool is_aid_a1 = (node->adev->rev_id & 0x10);
- bool is_local = (domain == SVM_RANGE_VRAM_DOMAIN) &&
+ is_aid_a1 = (node->adev->rev_id & 0x10);
+ is_local = (domain == SVM_RANGE_VRAM_DOMAIN) &&
(bo_node->adev == node->adev);
mtype_local = amdgpu_mtype_local == 0 ? AMDGPU_VM_MTYPE_RW :