[Powertop] [PATCH 10/10] Fixed cpu_core::has_c1_res initialization

Sergey Senozhatsky <sergey.senozhatsky at gmail.com>
Newsgroups dev.linux.lists.powertop
Message-ID <[email protected]>
From: David Rosca <nowrep(a)gmail.com>

cpu_core::has_c1_res is left uninitialized for anything other than BYT-M,
resulting in error at startup:
	 read_msr cpu0 0x660 : Argument list too long.

Signed-off-by: David Rosca <nowrep(a)gmail.com>
---
 src/cpu/intel_cpus.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/cpu/intel_cpus.cpp b/src/cpu/intel_cpus.cpp
index 3348dba..194dc75 100644
--- a/src/cpu/intel_cpus.cpp
+++ b/src/cpu/intel_cpus.cpp
@@ -101,8 +101,10 @@ nhm_core::nhm_core(int model)
 	if (model == 0x37) {
 		has_c3_res = 0;
 		has_c1_res = 1;
-	} else
+	} else {
 		has_c3_res = 1;
+		has_c1_res = 0;
+	}
 }
 
 void nhm_core::measurement_start(void)
-- 
1.8.4.679.g0a1a803
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.