[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 2/6] x86/numa: Correct the extern of cpu_to_node



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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.