lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 11 May 2017 10:39:10 +0200 (CEST)
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Stephen Rothwell <sfr@...b.auug.org.au>
cc:     Anju T Sudhakar <anju@...ux.vnet.ibm.com>,
        stewart@...ux.vnet.ibm.com, ego@...ux.vnet.ibm.com,
        mikey@...ling.org, maddy@...ux.vnet.ibm.com,
        Peter Zijlstra <peterz@...radead.org>,
        LKML <linux-kernel@...r.kernel.org>, eranian@...gle.com,
        hemant@...ux.vnet.ibm.com, Anton Blanchard <anton@...ba.org>,
        sukadev@...ux.vnet.ibm.com, linuxppc-dev@...ts.ozlabs.org,
        dja@...ens.net
Subject: Re: [PATCH v8 05/10] powerpc/perf: IMC pmu cpumask and cpuhotplug
 support

On Thu, 11 May 2017, Stephen Rothwell wrote:

> Hi,
> 
> On Wed, 10 May 2017 14:09:53 +0200 (CEST) Thomas Gleixner <tglx@...utronix.de> 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





Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ