[PATCH] cxl/hdm: Debug, use decoder name function

From: Ira Weiny
Date: Sat Sep 02 2023 - 22:52:45 EST


The decoder enum has a name conversion function defined now.

Use that instead of open coding.

Suggested-by: Navneet Singh <navneet.singh@xxxxxxxxx>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
Reviewed-by: Dave Jiang <dave.jiang@xxxxxxxxx>
Reviewed-by: Fan Ni <fan.ni@xxxxxxxxxxx>
Signed-off-by: Ira Weiny <ira.weiny@xxxxxxxxx>
---
Changes:
[iweiny: split out from DCD series]
https://lore.kernel.org/r/20230604-dcd-type2-upstream-v2-0-f740c47e7916@xxxxxxxxx
---
drivers/cxl/core/hdm.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c
index 4449b34a80cc..4fa49923eac0 100644
--- a/drivers/cxl/core/hdm.c
+++ b/drivers/cxl/core/hdm.c
@@ -530,8 +530,7 @@ int cxl_dpa_alloc(struct cxl_endpoint_decoder *cxled, unsigned long long size)

if (size > avail) {
dev_dbg(dev, "%pa exceeds available %s capacity: %pa\n", &size,
- cxled->mode == CXL_DECODER_RAM ? "ram" : "pmem",
- &avail);
+ cxl_decoder_mode_name(cxled->mode), &avail);
rc = -ENOSPC;
goto out;
}

---
base-commit: 1c59d383390f970b891b503b7f79b63a02db2ec5
change-id: 20230902-use-decoder-name-2bbaa033c53e

Best regards,
--
Ira Weiny <ira.weiny@xxxxxxxxx>