Skip to content

Commit f76e0bb

Browse files
shijujose4davejiang
authored andcommitted
cxl: Update prototype of function get_support_feature_info()
Add following changes to function get_support_feature_info() 1. Make generic to share between cxl-fwctl and cxl-edac paths. 2. Rename get_support_feature_info() to cxl_feature_info() 3. Change parameter const struct fwctl_rpc_cxl *rpc_in to const uuid_t *uuid. Suggested-by: Dan Williams <dan.j.williams@intel.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Shiju Jose <shiju.jose@huawei.com> Reviewed-by: Fan Ni <fan.ni@samsung.com> Reviewed-by: Alison Schofield <alison.schofield@intel.com> Acked-by: Dan Williams <dan.j.williams@intel.com> Link: https://patch.msgid.link/20250521124749.817-3-shiju.jose@huawei.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
1 parent ee4f032 commit f76e0bb

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

drivers/cxl/core/core.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ int cxl_acpi_get_extended_linear_cache_size(struct resource *backing_res,
124124
int nid, resource_size_t *size);
125125

126126
#ifdef CONFIG_CXL_FEATURES
127+
struct cxl_feat_entry *
128+
cxl_feature_info(struct cxl_features_state *cxlfs, const uuid_t *uuid);
127129
size_t cxl_get_feature(struct cxl_mailbox *cxl_mbox, const uuid_t *feat_uuid,
128130
enum cxl_get_feat_selection selection,
129131
void *feat_out, size_t feat_out_size, u16 offset,

drivers/cxl/core/features.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -355,17 +355,11 @@ static void cxlctl_close_uctx(struct fwctl_uctx *uctx)
355355
{
356356
}
357357

358-
static struct cxl_feat_entry *
359-
get_support_feature_info(struct cxl_features_state *cxlfs,
360-
const struct fwctl_rpc_cxl *rpc_in)
358+
struct cxl_feat_entry *
359+
cxl_feature_info(struct cxl_features_state *cxlfs,
360+
const uuid_t *uuid)
361361
{
362362
struct cxl_feat_entry *feat;
363-
const uuid_t *uuid;
364-
365-
if (rpc_in->op_size < sizeof(uuid))
366-
return ERR_PTR(-EINVAL);
367-
368-
uuid = &rpc_in->set_feat_in.uuid;
369363

370364
for (int i = 0; i < cxlfs->entries->num_features; i++) {
371365
feat = &cxlfs->entries->ent[i];
@@ -547,7 +541,10 @@ static bool cxlctl_validate_set_features(struct cxl_features_state *cxlfs,
547541
struct cxl_feat_entry *feat;
548542
u32 flags;
549543

550-
feat = get_support_feature_info(cxlfs, rpc_in);
544+
if (rpc_in->op_size < sizeof(uuid_t))
545+
return ERR_PTR(-EINVAL);
546+
547+
feat = cxl_feature_info(cxlfs, &rpc_in->set_feat_in.uuid);
551548
if (IS_ERR(feat))
552549
return false;
553550

0 commit comments

Comments
 (0)