Re: [PATCH 6/9] perf: Generic pci uncore device support
From: Peter Zijlstra
Date: Thu May 03 2012 - 17:40:08 EST
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/