Linux CXL
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
To: <alison.schofield@intel.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
	Dave Jiang <dave.jiang@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Ira Weiny <ira.weiny@intel.com>,
	Dan Williams <dan.j.williams@intel.com>,
	<linux-cxl@vger.kernel.org>, <shiju.jose@huawei.com>
Subject: Re: [PATCH] cxl/features: Remove the inline specifier from to_cxlfs()
Date: Thu, 22 May 2025 09:25:11 +0100	[thread overview]
Message-ID: <20250522092511.0000690b@huawei.com> (raw)
In-Reply-To: <20250521233625.1745849-1-alison.schofield@intel.com>

On Wed, 21 May 2025 16:36:23 -0700
alison.schofield@intel.com wrote:

> From: Alison Schofield <alison.schofield@intel.com>
> 
> to_cxlfs() was declared 'inline' in the header but only defined in
> drivers/cxl/core/features.c. This has worked because features.c was
> the only file using the function and the definition happened to be
> available in the same compilation unit.
> 
> However, in preparation for a second .c file using the header and
> needing to call the function, the inline specifier became an issue.
> Sparse flagged the declaration as invalid since 'inline' requires a
> visible definition at the point of use.
> 
> Defining the function in the header was considered but rejected, as
> it depends on internal symbols not visible at that level.
> 
> Remove the inline specifier to correct the linkage violation.
> 
> Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Thanks for the quick turn around.

> ---
> 
> I intentionally did not add a Fixes Tag at the point this was
> introduced because there is no breakage until the second user
> comes along. 
> 
> The second user is this patchset being reviewed:
> [PATCH v6 0/8] cxl: support CXL memory RAS features
> https://lore.kernel.org/linux-cxl/20250521124749.817-1-shiju.jose@huawei.com/
> 
> 
>  drivers/cxl/core/features.c | 2 +-
>  include/cxl/features.h      | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/cxl/core/features.c b/drivers/cxl/core/features.c
> index 1498e2369c37..efe88c043227 100644
> --- a/drivers/cxl/core/features.c
> +++ b/drivers/cxl/core/features.c
> @@ -36,7 +36,7 @@ static bool is_cxl_feature_exclusive(struct cxl_feat_entry *entry)
>  	return is_cxl_feature_exclusive_by_uuid(&entry->uuid);
>  }
>  
> -inline struct cxl_features_state *to_cxlfs(struct cxl_dev_state *cxlds)
> +struct cxl_features_state *to_cxlfs(struct cxl_dev_state *cxlds)
>  {
>  	return cxlds->cxlfs;
>  }
> diff --git a/include/cxl/features.h b/include/cxl/features.h
> index 5f7f842765a5..b9297693dae7 100644
> --- a/include/cxl/features.h
> +++ b/include/cxl/features.h
> @@ -64,7 +64,7 @@ struct cxl_features_state {
>  struct cxl_mailbox;
>  struct cxl_memdev;
>  #ifdef CONFIG_CXL_FEATURES
> -inline struct cxl_features_state *to_cxlfs(struct cxl_dev_state *cxlds);
> +struct cxl_features_state *to_cxlfs(struct cxl_dev_state *cxlds);
>  int devm_cxl_setup_features(struct cxl_dev_state *cxlds);
>  int devm_cxl_setup_fwctl(struct device *host, struct cxl_memdev *cxlmd);
>  #else
> 
> base-commit: 92a09c47464d040866cf2b4cd052bc60555185fb


  parent reply	other threads:[~2025-05-22  8:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-21 23:36 [PATCH] cxl/features: Remove the inline specifier from to_cxlfs() alison.schofield
2025-05-21 23:38 ` Dave Jiang
2025-05-22  8:25 ` Jonathan Cameron [this message]
2025-05-22  8:46 ` Shiju Jose

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=20250522092511.0000690b@huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=ira.weiny@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=shiju.jose@huawei.com \
    --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