From patchwork Fri Dec 14 13:17:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sivaram Nair X-Patchwork-Id: 1878541 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 8EBAEDF230 for ; Fri, 14 Dec 2012 13:18:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754735Ab2LNNS2 (ORCPT ); Fri, 14 Dec 2012 08:18:28 -0500 Received: from hqemgate03.nvidia.com ([216.228.121.140]:3007 "EHLO hqemgate03.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754116Ab2LNNS1 (ORCPT ); Fri, 14 Dec 2012 08:18:27 -0500 Received: from hqnvupgp08.nvidia.com (Not Verified[216.228.121.13]) by hqemgate03.nvidia.com id ; Fri, 14 Dec 2012 05:21:54 -0800 Received: from hqemhub01.nvidia.com ([172.17.108.22]) by hqnvupgp08.nvidia.com (PGP Universal service); Fri, 14 Dec 2012 05:16:38 -0800 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Fri, 14 Dec 2012 05:16:38 -0800 Received: from hqnvemgw01.nvidia.com (172.20.150.20) by hqemhub01.nvidia.com (172.20.150.30) with Microsoft SMTP Server id 8.3.279.1; Fri, 14 Dec 2012 05:18:25 -0800 Received: from daphne.nvidia.com (Not Verified[172.16.212.96]) by hqnvemgw01.nvidia.com with MailMarshal (v6,7,2,8378) id ; Fri, 14 Dec 2012 05:18:34 -0800 Received: from sivaramn-lnx.Nvidia.com (dhcp-10-21-25-217.nvidia.com [10.21.25.217]) by daphne.nvidia.com (8.13.8+Sun/8.8.8) with ESMTP id qBEDHp0J006732; Fri, 14 Dec 2012 05:18:23 -0800 (PST) From: Sivaram Nair To: , , , , CC: , Sivaram Nair , Subject: [PATCH 2/2] cpuidle: fix sysfs output for power_usage Date: Fri, 14 Dec 2012 15:17:37 +0200 Message-ID: <1355491060-970-2-git-send-email-sivaramn@nvidia.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1355491060-970-1-git-send-email-sivaramn@nvidia.com> References: <1355491060-970-1-git-send-email-sivaramn@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org cpuidle_state->power_usage is signed; so change the corresponding sysfs ops to output signed value instead of unsigned. Signed-off-by: Sivaram Nair --- drivers/cpuidle/sysfs.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c index 3409429..2fc79cd 100644 --- a/drivers/cpuidle/sysfs.c +++ b/drivers/cpuidle/sysfs.c @@ -232,6 +232,13 @@ static struct cpuidle_state_attr attr_##_name = __ATTR(_name, 0644, show, store) static ssize_t show_state_##_name(struct cpuidle_state *state, \ struct cpuidle_state_usage *state_usage, char *buf) \ { \ + return sprintf(buf, "%d\n", state->_name);\ +} + +#define define_show_state_u_function(_name) \ +static ssize_t show_state_##_name(struct cpuidle_state *state, \ + struct cpuidle_state_usage *state_usage, char *buf) \ +{ \ return sprintf(buf, "%u\n", state->_name);\ } @@ -270,7 +277,7 @@ static ssize_t show_state_##_name(struct cpuidle_state *state, \ return sprintf(buf, "%s\n", state->_name);\ } -define_show_state_function(exit_latency) +define_show_state_u_function(exit_latency) define_show_state_function(power_usage) define_show_state_ull_function(usage) define_show_state_ull_function(time)