Switch to unsigned int for the dom0 e820 index. This eliminates the
potential for array underflows, and the compiler might be able to
generate better code.
Requested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
{
paddr_t kernel_size = elf->dest_size;
unsigned int align;
- int i;
+ unsigned int i;
if ( parms->phys_align != UNSET_ADDR32 )
align = parms->phys_align;
align = MB(2);
/* Search backwards to find the highest address. */
- for ( i = d->arch.nr_e820 - 1; i >= 0 ; i-- )
+ for ( i = d->arch.nr_e820; i--; )
{
paddr_t start = d->arch.e820[i].addr;
paddr_t end = start + d->arch.e820[i].size;