Since the counter is unsigned, it's pointless/bogous to check
for if to be above zero.
Check that it is at least one before it's decremented, instead.
Spotted by Coverity.
Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
Release-acked-by: Julien Grall <julien.grall@arm.com>
dec_nr_runnable(unsigned int cpu)
{
ASSERT(spin_is_locked(per_cpu(schedule_data, cpu).schedule_lock));
+ ASSERT(CSCHED_PCPU(cpu)->nr_runnable >= 1);
CSCHED_PCPU(cpu)->nr_runnable--;
- ASSERT(CSCHED_PCPU(cpu)->nr_runnable >= 0);
}
static inline void