Hi Dario,
On 13/04/17 08:49, Dario Faggioli wrote:
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.
Do you have the Coverity-ID? :)
Reported-by: Andrew Cooper <andrew.coop...@citrix.com>
Signed-off-by: Dario Faggioli <dario.faggi...@citrix.com>
---
Cc: George Dunlap <george.dun...@citrix.com>
Cc: Andrew Cooper <andrew.coop...@citrix.com>
Cc: Julien Grall <julien.gr...@arm.com>
---
Julien,
This is very low risk, and I'd call it a bugfix in the sense that it quiesces
coverity.
Release-Acked-by: Julien Grall <julien.gr...@arm.com>
Dario
---
xen/common/sched_credit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 93658dc..efdf6bf 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -275,8 +275,8 @@ static inline void
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
Cheers,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel