From patchwork Wed Feb 2 23:26:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naga Chumbalkar X-Patchwork-Id: 528071 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p12NR0Kv018865 for ; Wed, 2 Feb 2011 23:27:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751702Ab1BBX1A (ORCPT ); Wed, 2 Feb 2011 18:27:00 -0500 Received: from g4t0014.houston.hp.com ([15.201.24.17]:39838 "EHLO g4t0014.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755262Ab1BBX07 (ORCPT ); Wed, 2 Feb 2011 18:26:59 -0500 Received: from g4t0018.houston.hp.com (g4t0018.houston.hp.com [16.234.32.27]) by g4t0014.houston.hp.com (Postfix) with ESMTP id 0314024305; Wed, 2 Feb 2011 23:26:58 +0000 (UTC) Received: from nchumbalkar.americas.hpqcorp.net (unknown [16.84.209.17]) by g4t0018.houston.hp.com (Postfix) with ESMTP id E6A4610259; Wed, 2 Feb 2011 23:26:58 +0000 (UTC) From: Naga Chumbalkar To: lenb@kernel.org Cc: linux-acpi@vger.kernel.org, Naga Chumbalkar Message-Id: <20110202232425.22145.40776.sendpatchset@nchumbalkar.americas.hpqcorp.net> Subject: [PATCH 1/2] ACPI: make acpi_pad /sys output more readable Date: Wed, 2 Feb 2011 23:26:58 +0000 (UTC) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 02 Feb 2011 23:27:15 +0000 (UTC) diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c index 6afceb3..474be3a 100644 --- a/drivers/acpi/acpi_pad.c +++ b/drivers/acpi/acpi_pad.c @@ -298,7 +298,7 @@ static ssize_t acpi_pad_rrtime_store(struct device *dev, static ssize_t acpi_pad_rrtime_show(struct device *dev, struct device_attribute *attr, char *buf) { - return scnprintf(buf, PAGE_SIZE, "%d", round_robin_time); + return scnprintf(buf, PAGE_SIZE, "%d\n", round_robin_time); } static DEVICE_ATTR(rrtime, S_IRUGO|S_IWUSR, acpi_pad_rrtime_show, @@ -321,7 +321,7 @@ static ssize_t acpi_pad_idlepct_store(struct device *dev, static ssize_t acpi_pad_idlepct_show(struct device *dev, struct device_attribute *attr, char *buf) { - return scnprintf(buf, PAGE_SIZE, "%d", idle_pct); + return scnprintf(buf, PAGE_SIZE, "%d\n", idle_pct); } static DEVICE_ATTR(idlepct, S_IRUGO|S_IWUSR, acpi_pad_idlepct_show, @@ -342,8 +342,11 @@ static ssize_t acpi_pad_idlecpus_store(struct device *dev, static ssize_t acpi_pad_idlecpus_show(struct device *dev, struct device_attribute *attr, char *buf) { - return cpumask_scnprintf(buf, PAGE_SIZE, - to_cpumask(pad_busy_cpus_bits)); + int n = 0; + n = cpumask_scnprintf(buf, PAGE_SIZE-2, to_cpumask(pad_busy_cpus_bits)); + buf[n++] = '\n'; + buf[n] = '\0'; + return n; } static DEVICE_ATTR(idlecpus, S_IRUGO|S_IWUSR, acpi_pad_idlecpus_show,