summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdkfd/kfd_topology.h
diff options
context:
space:
mode:
authorMichael Chen <michael.chen@amd.com>2024-05-03 22:31:08 +0300
committerAlex Deucher <alexander.deucher@amd.com>2024-05-09 01:46:26 +0300
commit10f624ef239bd136cdcc5bbc626157a57b938a31 (patch)
tree0196d2fa01a3fd3b7519f1fd3ca415728e353206 /drivers/gpu/drm/amd/amdkfd/kfd_topology.h
parentc4dcb47d46144d8f5b1ace1d8d2fcddeb5dacd8e (diff)
downloadlinux-10f624ef239bd136cdcc5bbc626157a57b938a31.tar.xz
drm/amdkfd: Reconcile the definition and use of oem_id in struct kfd_topology_device
Currently oem_id is defined as uint8_t[6] and casted to uint64_t* in some use case. This would lead code scanner to complain about access beyond. Re-define it in union to enforce 8-byte size and alignment to avoid potential issue. Signed-off-by: Michael Chen <michael.chen@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_topology.h')
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_topology.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.h b/drivers/gpu/drm/amd/amdkfd/kfd_topology.h
index 27386ce9a021..2d1c9d771bef 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.h
@@ -154,7 +154,10 @@ struct kfd_topology_device {
struct attribute attr_gpuid;
struct attribute attr_name;
struct attribute attr_props;
- uint8_t oem_id[CRAT_OEMID_LENGTH];
+ union {
+ uint8_t oem_id[CRAT_OEMID_LENGTH];
+ uint64_t oem_id64;
+ };
uint8_t oem_table_id[CRAT_OEMTABLEID_LENGTH];
uint32_t oem_revision;
};