Skip to content

Commit 4d449c3

Browse files
author
John W. Linville
committed
cxl/feature: Remove redundant code of get supported features
JIRA: https://issues.redhat.com/browse/RHEL-107284 commit 6eed708 Author: Li Ming <ming.li@zohomail.com> Date: Fri May 16 22:32:20 2025 +0800 cxl/feature: Remove redundant code of get supported features In cxlctl_get_supported_features(), there is a code block that handles the case where the requested is equal to 0. But the code following the code block can also handle this situation. So the code block is not needed. Signed-off-by: Li Ming <ming.li@zohomail.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Link: https://patch.msgid.link/20250516143220.35302-1-ming.li@zohomail.com Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: John W. Linville <linville@redhat.com>
1 parent a725a8c commit 4d449c3

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

drivers/cxl/core/features.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -426,14 +426,6 @@ static void *cxlctl_get_supported_features(struct cxl_features_state *cxlfs,
426426

427427
rpc_out->size = struct_size(feat_out, ents, requested);
428428
feat_out = &rpc_out->get_sup_feats_out;
429-
if (requested == 0) {
430-
feat_out->num_entries = cpu_to_le16(requested);
431-
feat_out->supported_feats =
432-
cpu_to_le16(cxlfs->entries->num_features);
433-
rpc_out->retval = CXL_MBOX_CMD_RC_SUCCESS;
434-
*out_len = out_size;
435-
return no_free_ptr(rpc_out);
436-
}
437429

438430
for (i = start, pos = &feat_out->ents[0];
439431
i < cxlfs->entries->num_features; i++, pos++) {

0 commit comments

Comments
 (0)