Use standard cpumap_print_to_pagebuf() instead of hand-crafted function when displaying the cpu map. Signed-off-by: Hannes Reinecke <hare@xxxxxxxx> --- block/blk-mq-sysfs.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/block/blk-mq-sysfs.c b/block/blk-mq-sysfs.c index 1cf1878..f817561 100644 --- a/block/blk-mq-sysfs.c +++ b/block/blk-mq-sysfs.c @@ -231,20 +231,7 @@ static ssize_t blk_mq_hw_sysfs_active_show(struct blk_mq_hw_ctx *hctx, char *pag static ssize_t blk_mq_hw_sysfs_cpus_show(struct blk_mq_hw_ctx *hctx, char *page) { - unsigned int i, first = 1; - ssize_t ret = 0; - - for_each_cpu(i, hctx->cpumask) { - if (first) - ret += sprintf(ret + page, "%u", i); - else - ret += sprintf(ret + page, ", %u", i); - - first = 0; - } - - ret += sprintf(ret + page, "\n"); - return ret; + return cpumap_print_to_pagebuf(true, page, hctx->cpumask); } static struct blk_mq_ctx_sysfs_entry blk_mq_sysfs_dispatched = { -- 1.8.5.6 -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html