From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751985AbbLMNFA (ORCPT ); Sun, 13 Dec 2015 08:05:00 -0500 Received: from mga14.intel.com ([192.55.52.115]:45969 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751351AbbLMNE7 (ORCPT ); Sun, 13 Dec 2015 08:04:59 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,422,1444719600"; d="scan'208";a="706487325" From: Chen Yu To: len.brown@intel.com Cc: rjw@rjwysocki.net, srinivas.pandruvada@intel.com, rui.zhang@intel.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] tools/power turbostat: bugfix: fix several invalid parameters Date: Sun, 13 Dec 2015 21:09:49 +0800 Message-Id: X-Mailer: git-send-email 1.8.4.2 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org dump_cstate_pstate_config_info is invoked with no parameters, which might cause this function to misjudge the processor family and model. Fix this by passing family and model to it. Besides, fix the compiling warning caused by missing type declaration in dump_cstate_pstate_config_info, get_tdp and perf_limit_reasons_probe: turbostat.c: In function ‘dump_cstate_pstate_config_info’: turbostat.c:1973:1: warning: type of ‘family’ defaults to ‘int’ [-Wimplicit-int] dump_cstate_pstate_config_info(family, model) ^ turbostat.c:1973:1: warning: type of ‘model’ defaults to ‘int’ [-Wimplicit-int] turbostat.c: In function ‘get_tdp’: turbostat.c:2145:8: warning: type of ‘model’ defaults to ‘int’ [-Wimplicit-int] double get_tdp(model) ^ turbostat.c: In function ‘perf_limit_reasons_probe’: turbostat.c:2259:6: warning: type of ‘family’ defaults to ‘int’ [-Wimplicit-int] void perf_limit_reasons_probe(family, model) ^ turbostat.c:2259:6: warning: type of ‘model’ defaults to ‘int’ [-Wimplicit-int] Signed-off-by: Chen Yu --- tools/power/x86/turbostat/turbostat.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 9854929..47068de 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -1970,7 +1970,7 @@ int has_config_tdp(unsigned int family, unsigned int model) } static void -dump_cstate_pstate_config_info(family, model) +dump_cstate_pstate_config_info(unsigned int family, unsigned int model) { if (!do_nhm_platform_info) return; @@ -2142,7 +2142,7 @@ int print_perf_limit(struct thread_data *t, struct core_data *c, struct pkg_data #define RAPL_POWER_GRANULARITY 0x7FFF /* 15 bit power granularity */ #define RAPL_TIME_GRANULARITY 0x3F /* 6 bit time granularity */ -double get_tdp(model) +double get_tdp(unsigned int model) { unsigned long long msr; @@ -2256,7 +2256,7 @@ void rapl_probe(unsigned int family, unsigned int model) return; } -void perf_limit_reasons_probe(family, model) +void perf_limit_reasons_probe(unsigned int family, unsigned int model) { if (!genuine_intel) return; @@ -2792,7 +2792,7 @@ void process_cpuid() perf_limit_reasons_probe(family, model); if (debug) - dump_cstate_pstate_config_info(); + dump_cstate_pstate_config_info(family, model); if (has_skl_msrs(family, model)) calculate_tsc_tweak(); -- 1.8.4.2