Skip to content

Commit e05501e

Browse files
davejiangdjbw
authored andcommitted
cxl: Add cxl_num_decoders_committed() usage to cxl_test
Commit 458ba81 ("cxl: Add cxl_decoders_committed() helper") missed the conversion for cxl_test. Add usage of cxl_num_decoders_committed() to replace the open coding. Suggested-by: Alison Schofield <alison.schofield@intel.com> Signed-off-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Fan Ni <fan.ni@samsung.com> Link: https://lore.kernel.org/r/169929160525.824083.11813222229025394254.stgit@djiang5-mobl3 Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent 0e33ac9 commit e05501e

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

tools/testing/cxl/Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,6 @@ cxl_core-$(CONFIG_TRACING) += $(CXL_CORE_SRC)/trace.o
6262
cxl_core-$(CONFIG_CXL_REGION) += $(CXL_CORE_SRC)/region.o
6363
cxl_core-y += config_check.o
6464
cxl_core-y += cxl_core_test.o
65+
cxl_core-y += cxl_core_exports.o
6566

6667
obj-m += test/

tools/testing/cxl/cxl_core_exports.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
/* Copyright(c) 2022 Intel Corporation. All rights reserved. */
3+
4+
#include "cxl.h"
5+
6+
/* Exporting of cxl_core symbols that are only used by cxl_test */
7+
EXPORT_SYMBOL_NS_GPL(cxl_num_decoders_committed, CXL);

tools/testing/cxl/test/cxl.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,10 +669,11 @@ static int mock_decoder_commit(struct cxl_decoder *cxld)
669669
return 0;
670670

671671
dev_dbg(&port->dev, "%s commit\n", dev_name(&cxld->dev));
672-
if (port->commit_end + 1 != id) {
672+
if (cxl_num_decoders_committed(port) != id) {
673673
dev_dbg(&port->dev,
674674
"%s: out of order commit, expected decoder%d.%d\n",
675-
dev_name(&cxld->dev), port->id, port->commit_end + 1);
675+
dev_name(&cxld->dev), port->id,
676+
cxl_num_decoders_committed(port));
676677
return -EBUSY;
677678
}
678679

0 commit comments

Comments
 (0)