Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752349AbbGWGtM (ORCPT ); Thu, 23 Jul 2015 02:49:12 -0400 Received: from e23smtp03.au.ibm.com ([202.81.31.145]:52353 "EHLO e23smtp03.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751306AbbGWGtH (ORCPT ); Thu, 23 Jul 2015 02:49:07 -0400 X-Helo: d23dlp03.au.ibm.com X-MailFrom: maddy@linux.vnet.ibm.com X-RcptTo: linux-kernel@vger.kernel.org Message-ID: <55B08E28.3090902@linux.vnet.ibm.com> Date: Thu, 23 Jul 2015 12:18:08 +0530 From: Madhavan Srinivasan User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Daniel Axtens CC: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Peter Zijlstra , Stephane Eranian , Paul Mackerras , Anton Blanchard , Preeti U Murthy , Sukadev Bhattiprolu , Ingo Molnar , Anshuman Khandual Subject: Re: [PATCH v5 7/7] powerpc/powernv: nest pmu cpumask and cpu hotplug support References: <1437045206-7491-1-git-send-email-maddy@linux.vnet.ibm.com> <1437045206-7491-8-git-send-email-maddy@linux.vnet.ibm.com> <1437541404.30906.43.camel@axtens.net> In-Reply-To: <1437541404.30906.43.camel@axtens.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15072306-0009-0000-0000-000001C281FB Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 856 Lines: 28 On Wednesday 22 July 2015 10:33 AM, Daniel Axtens 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++) >> + perf_pmu_migrate_context(&per_nest_pmu_arr[i]->pmu, >> + old_cpu, new_cpu); > From patch 4, I see per_nest_pmu_arr is defined as: > +static struct nest_pmu *per_nest_pmu_arr[P8_NEST_MAX_PMUS]; > > Therefore, does this loop need to have a check that > i < P8_NEST_MAX_PMUS? No, that is max possible pmu, but we may have only couple for nest pmus registered. Thanks for the review comments Maddy > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/