[PATCH 10/16] RDMA/hfi1: Use sysfs_emit() for cpumask show helper

From: Yury Norov

Date: Thu May 28 2026 - 14:41:43 EST


sdma_get_cpu_to_sde_map() is used by a sysfs show callback.

Use sysfs_emit() and cpumask_pr_args() to emit the mask.

This prepares for removing cpumap_print_to_pagebuf().

Signed-off-by: Yury Norov <ynorov@xxxxxxxxxx>
---
drivers/infiniband/hw/hfi1/sdma.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/hfi1/sdma.c b/drivers/infiniband/hw/hfi1/sdma.c
index cfd9dd0f7e81..f253c8ee182d 100644
--- a/drivers/infiniband/hw/hfi1/sdma.c
+++ b/drivers/infiniband/hw/hfi1/sdma.c
@@ -11,6 +11,7 @@
#include <linux/timer.h>
#include <linux/vmalloc.h>
#include <linux/highmem.h>
+#include <linux/sysfs.h>

#include "hfi.h"
#include "common.h"
@@ -1049,7 +1050,7 @@ ssize_t sdma_get_cpu_to_sde_map(struct sdma_engine *sde, char *buf)
if (cpumask_empty(&sde->cpu_mask))
snprintf(buf, PAGE_SIZE, "%s\n", "empty");
else
- cpumap_print_to_pagebuf(true, buf, &sde->cpu_mask);
+ sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(&sde->cpu_mask));
mutex_unlock(&process_to_sde_mutex);
return strnlen(buf, PAGE_SIZE);
}
--
2.51.0