diff options
author | Matthew Brost <matthew.brost@intel.com> | 2024-10-17 20:00:39 -0700 |
---|---|---|
committer | Matthew Brost <matthew.brost@intel.com> | 2024-10-20 14:48:51 -0700 |
commit | 2677520152bc9e732d5e033fe013444db5b4db84 (patch) | |
tree | 9fefdc5d53ca1be849016746b701ac0d4f980bd5 /drivers/gpu/drm/xe | |
parent | 66426bf9e2c930683a883f82d5a471a778282569 (diff) | |
download | linux-stable-2677520152bc9e732d5e033fe013444db5b4db84.tar.gz linux-stable-2677520152bc9e732d5e033fe013444db5b4db84.tar.bz2 linux-stable-2677520152bc9e732d5e033fe013444db5b4db84.zip |
drm/xe: Use __counted_by for flexible arrays
Good practice to use __counted_by in kernel coding for flexible arrays.
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241018030039.1077842-1-matthew.brost@intel.com
Diffstat (limited to 'drivers/gpu/drm/xe')
-rw-r--r-- | drivers/gpu/drm/xe/xe_exec_queue_types.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/xe/xe_sched_job_types.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/xe/xe_exec_queue_types.h b/drivers/gpu/drm/xe/xe_exec_queue_types.h index 7deb480e26af..1158b6062a6c 100644 --- a/drivers/gpu/drm/xe/xe_exec_queue_types.h +++ b/drivers/gpu/drm/xe/xe_exec_queue_types.h @@ -143,7 +143,7 @@ struct xe_exec_queue { /** @hw_engine_group_link: link into exec queues in the same hw engine group */ struct list_head hw_engine_group_link; /** @lrc: logical ring context for this exec queue */ - struct xe_lrc *lrc[]; + struct xe_lrc *lrc[] __counted_by(width); }; /** diff --git a/drivers/gpu/drm/xe/xe_sched_job_types.h b/drivers/gpu/drm/xe/xe_sched_job_types.h index 0d3f76fb05ce..426d261d7359 100644 --- a/drivers/gpu/drm/xe/xe_sched_job_types.h +++ b/drivers/gpu/drm/xe/xe_sched_job_types.h @@ -63,7 +63,7 @@ struct xe_sched_job { struct xe_sched_job_snapshot { u16 batch_addr_len; - u64 batch_addr[]; + u64 batch_addr[] __counted_by(batch_addr_len); }; #endif |