Linux CXL
 help / color / mirror / Atom feed
From: Alison Schofield <alison.schofield@intel.com>
To: Dave Jiang <dave.jiang@intel.com>
Cc: linux-cxl@vger.kernel.org, dan.j.williams@intel.com,
	vishal.l.verma@intel.com, ira.weiny@intel.com
Subject: Re: [RESEND PATCH v2] cxl: Warn of flexible array in struct cxl_root_decoder
Date: Thu, 27 Apr 2023 12:02:21 -0700	[thread overview]
Message-ID: <ZErGvfsHRFkdO4pT@aschofie-mobl2> (raw)
In-Reply-To: <168261044311.369593.10950998135160952191.stgit@djiang5-mobl3>

On Thu, Apr 27, 2023 at 08:47:23AM -0700, Dave Jiang wrote:
> The 'cxl_switch_decoder' member in 'cxl_root_decoder' must be the last
> element due to 'cxl_switch_decoder' has a flexible array at the
> end of the struct. Any variables placed after will be corrupted.
> Add a warning comment to 'cxl_root_decoder'.
> 
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> 
> ---
> v2:
> - Clarify subject (Alison)
> - Fit comment under 80 chars. (Alison)

Thanks Dave,

Reviewed-by: Alison Schofield <alison.schofield@intel.com>

> ---
>  drivers/cxl/cxl.h |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/cxl/cxl.h b/drivers/cxl/cxl.h
> index 044a92d9813e..7db7e217b6f3 100644
> --- a/drivers/cxl/cxl.h
> +++ b/drivers/cxl/cxl.h
> @@ -419,6 +419,7 @@ struct cxl_root_decoder {
>  	cxl_calc_hb_fn calc_hb;
>  	void *platform_data;
>  	struct mutex range_lock;
> +	/* Must be the last member. Struct contains a flexible array */
>  	struct cxl_switch_decoder cxlsd;
>  };
>  
> 
> 

  parent reply	other threads:[~2023-04-27 19:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-27 15:47 [RESEND PATCH v2] cxl: Warn of flexible array in struct cxl_root_decoder Dave Jiang
2023-04-27 17:29 ` Ira Weiny
2023-04-27 19:02 ` Alison Schofield [this message]
2023-05-11 16:36 ` Jonathan Cameron

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=ZErGvfsHRFkdO4pT@aschofie-mobl2 \
    --to=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=ira.weiny@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=vishal.l.verma@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