Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ghimiray, Himal Prasad" <himal.prasad.ghimiray@intel.com>
To: Matthew Brost <matthew.brost@intel.com>,
	<intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH] drm/xe: Use __counted_by for flexible arrays
Date: Fri, 18 Oct 2024 09:19:27 +0530	[thread overview]
Message-ID: <63adcddf-4c71-4fb2-9585-fca4178ab152@intel.com> (raw)
In-Reply-To: <20241018030039.1077842-1-matthew.brost@intel.com>



On 18-10-2024 08:30, Matthew Brost wrote:
> Good practice to use __counted_by in kernel coding for flexible arrays.
> 
> Signed-off-by: Matthew Brost <matthew.brost@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_exec_queue_types.h | 2 +-
>   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);
>   };

LGTM
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>

>   
>   #endif


  parent reply	other threads:[~2024-10-18  3:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-18  3:00 [PATCH] drm/xe: Use __counted_by for flexible arrays Matthew Brost
2024-10-18  3:05 ` ✓ CI.Patch_applied: success for " Patchwork
2024-10-18  3:05 ` ✓ CI.checkpatch: " Patchwork
2024-10-18  3:06 ` ✓ CI.KUnit: " Patchwork
2024-10-18  3:18 ` ✓ CI.Build: " Patchwork
2024-10-18  3:21 ` ✓ CI.Hooks: " Patchwork
2024-10-18  3:23 ` ✓ CI.checksparse: " Patchwork
2024-10-18  3:42 ` ✓ CI.BAT: " Patchwork
2024-10-18  3:49 ` Ghimiray, Himal Prasad [this message]
2024-10-18 18:34 ` ✗ CI.FULL: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=63adcddf-4c71-4fb2-9585-fca4178ab152@intel.com \
    --to=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox