Skip to content

Commit bfc6270

Browse files
AlisonSchofielddavejiang
authored andcommitted
cxl/features: Remove the inline specifier from to_cxlfs()
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: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Shiju Jose <shiju.jose@huawei.com> Link: https://patch.msgid.link/20250521233625.1745849-1-alison.schofield@intel.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
1 parent b443265 commit bfc6270

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/cxl/core/features.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static bool is_cxl_feature_exclusive(struct cxl_feat_entry *entry)
3636
return is_cxl_feature_exclusive_by_uuid(&entry->uuid);
3737
}
3838

39-
inline struct cxl_features_state *to_cxlfs(struct cxl_dev_state *cxlds)
39+
struct cxl_features_state *to_cxlfs(struct cxl_dev_state *cxlds)
4040
{
4141
return cxlds->cxlfs;
4242
}

include/cxl/features.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct cxl_features_state {
6464
struct cxl_mailbox;
6565
struct cxl_memdev;
6666
#ifdef CONFIG_CXL_FEATURES
67-
inline struct cxl_features_state *to_cxlfs(struct cxl_dev_state *cxlds);
67+
struct cxl_features_state *to_cxlfs(struct cxl_dev_state *cxlds);
6868
int devm_cxl_setup_features(struct cxl_dev_state *cxlds);
6969
int devm_cxl_setup_fwctl(struct device *host, struct cxl_memdev *cxlmd);
7070
#else

0 commit comments

Comments
 (0)