ent.size = (uint64_t)(s - ctxt->s) << PAGE_SHIFT;
ent.type = E820_RESERVED;
buffer = guest_handle_cast(ctxt->map.buffer, e820entry_t);
- if ( __copy_to_guest_offset(buffer, ctxt->n, &ent, 1) < 0 )
+ if ( __copy_to_guest_offset(buffer, ctxt->n, &ent, 1) )
return -EFAULT;
ctxt->n++;
}
}
if ( ctxt.map.nr_entries <= ctxt.n + (e820.nr_map - i) )
return -EINVAL;
- if ( __copy_to_guest_offset(buffer, ctxt.n, e820.map + i, 1) < 0 )
+ if ( __copy_to_guest_offset(buffer, ctxt.n, e820.map + i, 1) )
return -EFAULT;
ctxt.s = PFN_UP(e820.map[i].addr + e820.map[i].size);
}
if ( copy_from_guest(&eoi, arg, 1) != 0 )
break;
ret = -EINVAL;
- if ( eoi.irq < 0 || eoi.irq >= v->domain->nr_pirqs )
+ if ( eoi.irq >= v->domain->nr_pirqs )
break;
if ( v->domain->arch.pirq_eoi_map )
evtchn_unmask(v->domain->pirq_to_evtchn[eoi.irq]);
}
if ( (g_info->xen_cpuid >= NR_CPUS) ||
- (g_info->xen_cpuid < 0) ||
!cpu_present(g_info->xen_cpuid) )
{
g_info->flags |= XEN_PCPU_FLAGS_INVALID;
if (!cpu_online(cpu) || !data || !processor_pminfo[cpu])
return -ENODEV;
- if ((perf->platform_limit < 0) ||
- (perf->platform_limit >= perf->state_count))
+ if (perf->platform_limit >= perf->state_count)
return -EINVAL;
memcpy(&policy, data, sizeof(struct cpufreq_policy));