From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 2/6] x86/numa: Correct the extern of cpu_to_node Date: Thu, 9 Apr 2015 16:05:36 +0100 Message-ID: <55269540.309@citrix.com> References: <1428427580-8854-1-git-send-email-andrew.cooper3@citrix.com> <1428427580-8854-3-git-send-email-andrew.cooper3@citrix.com> <20150409150025.GC34853@deinos.phlegethon.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150409150025.GC34853@deinos.phlegethon.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tim Deegan Cc: Boris Ostrovsky , Keir Fraser , Jan Beulich , Xen-devel List-Id: xen-devel@lists.xenproject.org On 09/04/15 16:00, Tim Deegan wrote: > At 18:26 +0100 on 07 Apr (1428431176), Andrew Cooper wrote: >> --- a/xen/include/asm-x86/numa.h >> +++ b/xen/include/asm-x86/numa.h >> @@ -9,7 +9,7 @@ >> >> extern int srat_rev; >> >> -extern unsigned char cpu_to_node[]; >> +extern nodeid_t cpu_to_node[NR_CPUS]; > Does the compiler do anything useful with the array size here? Specifying the size allows ARRAY_SIZE(cpu_to_node) to work in other translation units. It also allows static analysers to perform bounds checks, should they wish. > In particular does it check that it matches the size at the definition? It will complain if they are mismatched. ~Andrew