Skip to content

Commit e484b4b

Browse files
author
John W. Linville
committed
cxl: Update prototype of function get_support_feature_info()
JIRA: https://issues.redhat.com/browse/RHEL-107284 commit f76e0bb Author: Shiju Jose <shiju.jose@huawei.com> Date: Wed May 21 13:47:40 2025 +0100 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> Signed-off-by: John W. Linville <linville@redhat.com>
1 parent 1a86eb4 commit e484b4b

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
@@ -123,6 +123,8 @@ int cxl_acpi_get_extended_linear_cache_size(struct resource *backing_res,
123123
int nid, resource_size_t *size);
124124

125125
#ifdef CONFIG_CXL_FEATURES
126+
struct cxl_feat_entry *
127+
cxl_feature_info(struct cxl_features_state *cxlfs, const uuid_t *uuid);
126128
size_t cxl_get_feature(struct cxl_mailbox *cxl_mbox, const uuid_t *feat_uuid,
127129
enum cxl_get_feat_selection selection,
128130
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
@@ -365,17 +365,11 @@ static void cxlctl_close_uctx(struct fwctl_uctx *uctx)
365365
{
366366
}
367367

368-
static struct cxl_feat_entry *
369-
get_support_feature_info(struct cxl_features_state *cxlfs,
370-
const struct fwctl_rpc_cxl *rpc_in)
368+
struct cxl_feat_entry *
369+
cxl_feature_info(struct cxl_features_state *cxlfs,
370+
const uuid_t *uuid)
371371
{
372372
struct cxl_feat_entry *feat;
373-
const uuid_t *uuid;
374-
375-
if (rpc_in->op_size < sizeof(uuid))
376-
return ERR_PTR(-EINVAL);
377-
378-
uuid = &rpc_in->set_feat_in.uuid;
379373

380374
for (int i = 0; i < cxlfs->entries->num_features; i++) {
381375
feat = &cxlfs->entries->ent[i];
@@ -549,7 +543,10 @@ static bool cxlctl_validate_set_features(struct cxl_features_state *cxlfs,
549543
struct cxl_feat_entry *feat;
550544
u32 flags;
551545

552-
feat = get_support_feature_info(cxlfs, rpc_in);
546+
if (rpc_in->op_size < sizeof(uuid_t))
547+
return ERR_PTR(-EINVAL);
548+
549+
feat = cxl_feature_info(cxlfs, &rpc_in->set_feat_in.uuid);
553550
if (IS_ERR(feat))
554551
return false;
555552

0 commit comments

Comments
 (0)