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]
Message-ID: <1336081192.6509.29.camel@twins>
Date:	Thu, 03 May 2012 23:39:52 +0200
From:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
To:	"Yan, Zheng" <zheng.z.yan@...el.com>
Cc:	mingo@...e.hu, andi@...stfloor.org, eranian@...gle.com,
	jolsa@...hat.com, ming.m.lin@...el.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 6/9] perf: Generic pci uncore device support

On Wed, 2012-05-02 at 10:07 +0800, Yan, Zheng wrote:
> +       uncores = msr_uncores;
> +       while (1) {
> +               for (i = 0; uncores[i]; i++) {
> +                       type = uncores[i];
> +                       for (j = 0; j < type->num_boxes; j++) {
> +                               pmu = &type->pmus[j];
> +                               box = uncore_pmu_find_box(pmu, phyid);
> +                               WARN_ON_ONCE(box->cpu != -1);
> +                               box->cpu = cpu;
> +                       }
>                 }
> +               if (uncores != msr_uncores)
> +                       break;
> +               uncores = pci_uncores;
>         } 

Wouldn't it be better to pull the body out into a separate function and
do something like:

 __uncore_init_types(msr_uncores, cpu);
 __uncore_init_types(pci_uncores, cpu);

same for the other such construct..


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ