From patchwork Sat Jan 24 14:03:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 5699671 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id ECE41C058D for ; Sat, 24 Jan 2015 14:13:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1185E2010F for ; Sat, 24 Jan 2015 14:13:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 42C232010E for ; Sat, 24 Jan 2015 14:13:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YF1Qj-0002TM-E5; Sat, 24 Jan 2015 14:11:17 +0000 Received: from mail-qg0-x22e.google.com ([2607:f8b0:400d:c04::22e]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YF1QT-00024F-W9 for linux-arm-kernel@lists.infradead.org; Sat, 24 Jan 2015 14:11:03 +0000 Received: by mail-qg0-f46.google.com with SMTP id i50so1671284qgf.5 for ; Sat, 24 Jan 2015 06:10:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=34LowstRZdxPhgXZ22KNoPXPVLkHuqqpI1LwY2SrQ2Y=; b=yz2Fj3YRMvwir/HffftwKHT8m2548xb37syhozxOXJYtOE7s9z1p0wnhp58JRUXfcd cRVx2O/TX5UM/jsIxJfcFRqvp54aWNVzIF6Xob1OZTGl2x2RQUQNLbIj24n24iMGONik vLRch2eYn97Wlh1IEHOCcWqlyCh8fa1o6CTMxEve2h0NC5EH4b1eDWWdvbwQdLAqDd2f mtDdH33VcAIMvEDjZYWxb/4/cxcnxAcXGu00uztFu9Nj2KwYLKEzmtcY0c0zo736bGih 6XJjYXRWasrnHZJEpmd9CorzU1TdYLgA5FgJqRU5PvWQusN3GzzEoDshDNhpI6+UWRCn EWTA== X-Received: by 10.140.85.9 with SMTP id m9mr1065744qgd.7.1422108247562; Sat, 24 Jan 2015 06:04:07 -0800 (PST) Received: from htj.lan (207-38-238-8.c3-0.wsd-ubr1.qens-wsd.ny.cable.rcn.com. [207.38.238.8]) by mx.google.com with ESMTPSA id p10sm2629504qab.18.2015.01.24.06.04.05 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Jan 2015 06:04:06 -0800 (PST) From: Tejun Heo To: akpm@linux-foundation.org Subject: [PATCH 12/32] arm: use %*pb[l] to print bitmaps including cpumasks and nodemasks Date: Sat, 24 Jan 2015 09:03:18 -0500 Message-Id: <1422108218-25398-13-git-send-email-tj@kernel.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1422108218-25398-1-git-send-email-tj@kernel.org> References: <1422108218-25398-1-git-send-email-tj@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150124_061102_233634_29A6A84F X-CRM114-Status: GOOD ( 12.88 ) X-Spam-Score: -0.7 (/) Cc: Tejun Heo , Russell King , linux-kernel@vger.kernel.org, moderated for non-subscribers X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_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 printk and friends can now formap bitmaps using '%*pb[l]'. cpumask and nodemask also provide cpumask_pr_args() and nodemask_pr_args() respectively which can be used to generate the two printf arguments necessary to format the specified cpu/nodemask. * Line termination only requires one extra space at the end of the buffer. Use PAGE_SIZE - 1 instead of PAGE_SIZE - 2 when formatting. This patch is dependent on the following two patches. lib/vsprintf: implement bitmap printing through '%*pb[l]' cpumask, nodemask: implement cpumask/nodemask_pr_args() Please wait till the forementioned patches are merged to mainline before applying to subsystem trees. Signed-off-by: Tejun Heo Cc: Andrew Morton Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) --- drivers/bus/arm-cci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c index 0ce5e2d..84fd660 100644 --- a/drivers/bus/arm-cci.c +++ b/drivers/bus/arm-cci.c @@ -806,8 +806,8 @@ static int cci_pmu_event_init(struct perf_event *event) static ssize_t pmu_attr_cpumask_show(struct device *dev, struct device_attribute *attr, char *buf) { - int n = cpulist_scnprintf(buf, PAGE_SIZE - 2, &pmu->cpus); - + int n = scnprintf(buf, PAGE_SIZE - 1, "%*pbl", + cpumask_pr_args(&pmu->cpus)); buf[n++] = '\n'; buf[n] = '\0'; return n;