Thread (27 messages) 27 messages, 7 authors, 2017-05-17

Re: [PATCH v8 05/10] powerpc/perf: IMC pmu cpumask and cpuhotplug support

From: Thomas Gleixner <hidden>
Date: 2017-05-11 08:39:21
Also in: lkml

On Thu, 11 May 2017, Stephen Rothwell wrote:
Hi,

On Wed, 10 May 2017 14:09:53 +0200 (CEST) Thomas Gleixner [off-list ref] wrote:
quoted
quoted
+static void nest_change_cpu_context(int old_cpu, int new_cpu)
+{
+	int i;
+
+	for (i = 0;
+	     (per_nest_pmu_arr[i] != NULL) && (i < IMC_MAX_PMUS); i++)
+		perf_pmu_migrate_context(&per_nest_pmu_arr[i]->pmu,
+							old_cpu, new_cpu);  
Bah, this is horrible to read.

	struct imc_pmu **pn = per_nest_pmu_arr;
	int i;

	for (i = 0; *pn && i < IMC_MAX_PMUS; i++, pn++)
		perf_pmu_migrate_context(&(*pn)->pmu, old_cpu, new_cpu);
(Just a bit of bike shedding ...)

Or even (since "i" is not used any more):

	struct imc_pmu **pn;

	for (pn = per_nest_pmu_arr;
	     pn < &per_nest_pmu_arr[IMC_MAX_PMUS] && *pn;
	     pn++)
		perf_pmu_migrate_context(&(*pn)->pmu, old_cpu, new_cpu);
Which is equally unreadable as the original code I complained about. Is that
a corporate preference?

Thanks,

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