lkml.org 
[lkml]   [2012]   [May]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 6/9] perf: Generic pci uncore device support
From
Date
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..




\
 
 \ /
  Last update: 2012-05-04 00:01    [W:0.779 / U:0.380 seconds]
©2003-2014 Jasper Spaans. Advertise on this site