Thread (4 messages) flat view 4 messages, 2 authors, 2017-11-22

Re: [PATCH 2/2] powerpc/perf: Fix IMC_MAX_PMU macro

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2017-11-22 01:23:56

Madhavan Srinivasan [off-list ref] writes:
quoted hunk ↗ jump to hunk
diff --git a/arch/powerpc/platforms/powernv/opal-imc.c b/arch/powerpc/platforms/powernv/opal-imc.c
index b150f4deaccf..4764e6932cb7 100644
--- a/arch/powerpc/platforms/powernv/opal-imc.c
+++ b/arch/powerpc/platforms/powernv/opal-imc.c
@@ -153,6 +153,22 @@ static void disable_core_pmu_counters(void)
 	put_online_cpus();
 }
 
+int get_max_nest_dev(void)
+{
+	struct device_node *node;
+	u32 pmu_units, type;
+
+	for_each_compatible_node(node, NULL, IMC_DTB_UNIT_COMPAT) {
+		if (of_property_read_u32(node, "type", &type))
+			continue;
+
+		if (type == IMC_TYPE_CHIP)
+			pmu_units++;
+	}
+
+	return pmu_units;
+}
Breaks:

  arch/powerpc/platforms/powernv/opal-imc.c:169:2: error: 'pmu_units' may be used uninitialized in this function [-Werror=maybe-uninitialized]

http://kisskb.ellerman.id.au/kisskb/head/1e59fb813346ee43be2a3a9acf4aac2815af1284/

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help