Skip to content

Commit 2677520

Browse files
committed
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
1 parent 66426bf commit 2677520

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/gpu/drm/xe/xe_exec_queue_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ struct xe_exec_queue {
143143
/** @hw_engine_group_link: link into exec queues in the same hw engine group */
144144
struct list_head hw_engine_group_link;
145145
/** @lrc: logical ring context for this exec queue */
146-
struct xe_lrc *lrc[];
146+
struct xe_lrc *lrc[] __counted_by(width);
147147
};
148148

149149
/**

drivers/gpu/drm/xe/xe_sched_job_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ struct xe_sched_job {
6363

6464
struct xe_sched_job_snapshot {
6565
u16 batch_addr_len;
66-
u64 batch_addr[];
66+
u64 batch_addr[] __counted_by(batch_addr_len);
6767
};
6868

6969
#endif

0 commit comments

Comments
 (0)