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

Re: [Xen-devel] [PATCH 1/5] x86/cpuidle: replace a pointless NULL check



>>> On 01.08.18 at 16:33, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 01/08/18 15:31, Jan Beulich wrote:
>> The address of an array slot can't be NULL. Instead add a bounds check
>> to make sure the array indexing is valid (the check is against 2 since
>> slot zero of the array - corresponding to C0 - is of no interest here).
>>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> Wouldn't an expression involving ARRAY_SIZE() be more appropriate?

No, as this is a lower bounds check; ->count will never exceed the
upper bound.

> Either way, Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Thanks, Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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