ucq: Fix print_ucq() Two things: one was a u64 vs u32 (the slot is often > 4 GB), and the comma operator in the for loop's check was wrong. Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
diff --git a/kern/src/ucq.c b/kern/src/ucq.c index 8b24b7d..cabf077 100644 --- a/kern/src/ucq.c +++ b/kern/src/ucq.c
@@ -143,8 +143,8 @@ atomic_read(&ucq->nr_extra_pgs)); printk("prod_overflow: %d\n", ucq->prod_overflow); /* Try to see our previous ucqs */ - for (int i = atomic_read(&ucq->prod_idx), count = 0; - slot_is_good(i), count < 25; i--, count++) { + for (uintptr_t i = atomic_read(&ucq->prod_idx), count = 0; + slot_is_good(i) && count < 25; i--, count++) { /* only attempt to print messages on the same page */ if (PTE_ADDR(i) != PTE_ADDR(atomic_read(&ucq->prod_idx))) break;