From: Shiju Jose <shiju.jose@huawei.com>
To: "alison.schofield@intel.com" <alison.schofield@intel.com>,
Davidlohr Bueso <dave@stgolabs.net>,
Jonathan Cameron <jonathan.cameron@huawei.com>,
"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>
Cc: "linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>
Subject: RE: [PATCH] cxl/features: Remove the inline specifier from to_cxlfs()
Date: Thu, 22 May 2025 08:46:37 +0000 [thread overview]
Message-ID: <c83ef693e8844168a79d8dd335374f32@huawei.com> (raw)
In-Reply-To: <20250521233625.1745849-1-alison.schofield@intel.com>
>-----Original Message-----
>From: alison.schofield@intel.com <alison.schofield@intel.com>
>Sent: 22 May 2025 00:36
>To: Davidlohr Bueso <dave@stgolabs.net>; Jonathan Cameron
><jonathan.cameron@huawei.com>; Dave Jiang <dave.jiang@intel.com>; Alison
>Schofield <alison.schofield@intel.com>; Vishal Verma
><vishal.l.verma@intel.com>; Ira Weiny <ira.weiny@intel.com>; Dan Williams
><dan.j.williams@intel.com>
>Cc: linux-cxl@vger.kernel.org
>Subject: [PATCH] cxl/features: Remove the inline specifier from to_cxlfs()
>
>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>
Thanks Alison.
Reviewed-by: Shiju Jose <shiju.jose@huawei.com>
>---
>
>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
>--
>2.37.3
>
prev parent reply other threads:[~2025-05-22 8:46 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
2025-05-22 8:46 ` Shiju Jose [this message]
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=c83ef693e8844168a79d8dd335374f32@huawei.com \
--to=shiju.jose@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=jonathan.cameron@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.