From patchwork Tue Mar 15 08:21:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 8586171 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 095589F44D for ; Tue, 15 Mar 2016 08:21:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9156B2021B for ; Tue, 15 Mar 2016 08:21:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 952BD2025B for ; Tue, 15 Mar 2016 08:21:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934394AbcCOIVL (ORCPT ); Tue, 15 Mar 2016 04:21:11 -0400 Received: from mx2.suse.de ([195.135.220.15]:59541 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933992AbcCOIVL (ORCPT ); Tue, 15 Mar 2016 04:21:11 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B511FAAB4; Tue, 15 Mar 2016 08:21:08 +0000 (UTC) From: Hannes Reinecke To: Jens Axboe Cc: Christoph Hellwig , linux-block@vger.kernel.org, Hannes Reinecke , Hannes Reinecke Subject: [PATCH] blk-mq: use cpumap_print_to_pagebuf() Date: Tue, 15 Mar 2016 09:21:07 +0100 Message-Id: <1458030067-46850-1-git-send-email-hare@suse.de> X-Mailer: git-send-email 1.8.5.6 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use standard cpumap_print_to_pagebuf() instead of hand-crafted function when displaying the cpu map. Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- 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 = {