@@ -43,6 +43,7 @@ int cxl_num_decoders_committed(struct cxl_port *port)
return port->commit_end + 1;
}
+EXPORT_SYMBOL_NS_GPL(cxl_num_decoders_committed, CXL);
static ssize_t devtype_show(struct device *dev, struct device_attribute *attr,
char *buf)
@@ -669,10 +669,11 @@ static int mock_decoder_commit(struct cxl_decoder *cxld)
return 0;
dev_dbg(&port->dev, "%s commit\n", dev_name(&cxld->dev));
- if (port->commit_end + 1 != id) {
+ if (cxl_num_decoders_committed(port) != id) {
dev_dbg(&port->dev,
"%s: out of order commit, expected decoder%d.%d\n",
- dev_name(&cxld->dev), port->id, port->commit_end + 1);
+ dev_name(&cxld->dev), port->id,
+ cxl_num_decoders_committed(port));
return -EBUSY;
}
Commit 458ba8189cb4 ("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> --- v2: - Add missing changes, stg refresh foobar --- drivers/cxl/core/port.c | 1 + tools/testing/cxl/test/cxl.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-)