From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755364AbdEKIjV (ORCPT ); Thu, 11 May 2017 04:39:21 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:47994 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754859AbdEKIjU (ORCPT ); Thu, 11 May 2017 04:39:20 -0400 Date: Thu, 11 May 2017 10:39:10 +0200 (CEST) From: Thomas Gleixner To: Stephen Rothwell cc: Anju T Sudhakar , stewart@linux.vnet.ibm.com, ego@linux.vnet.ibm.com, mikey@neuling.org, maddy@linux.vnet.ibm.com, Peter Zijlstra , LKML , eranian@google.com, hemant@linux.vnet.ibm.com, Anton Blanchard , sukadev@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org, dja@axtens.net Subject: Re: [PATCH v8 05/10] powerpc/perf: IMC pmu cpumask and cpuhotplug support In-Reply-To: <20170511094022.38a32f2e@canb.auug.org.au> Message-ID: References: <1493907596-11425-1-git-send-email-anju@linux.vnet.ibm.com> <1493907596-11425-6-git-send-email-anju@linux.vnet.ibm.com> <20170511094022.38a32f2e@canb.auug.org.au> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 11 May 2017, Stephen Rothwell wrote: > Hi, > > On Wed, 10 May 2017 14:09:53 +0200 (CEST) Thomas Gleixner wrote: > > > > > +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