>>> On 06.12.16 at 14:49, <roger....@citrix.com> wrote:
>> --- a/xen/common/libelf/libelf-tools.c
>> +++ b/xen/common/libelf/libelf-tools.c
>> @@ -131,9 +131,10 @@ unsigned elf_shdr_count(struct elf_binar
>>  {
>>      unsigned count = elf_uval(elf, elf->ehdr, e_shnum);
>>      uint64_t max = elf->size / sizeof(Elf32_Shdr);
>> -    if (max > ~(unsigned)0)
>> -        max = ~(unsigned)0; /* Xen doesn't have limits.h :-/ */
>> -    if (count > max)
>> +
>> +    if ( max > UINT_MAX )
>> +        max = UINT_MAX;
> 
> Can't you use a min helper here? It would be clear IMHO.

I'm afraid there's no min() available that would work (build) equally
in both libxc and hypervisor context.

Jan


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

Reply via email to