On 5/6/22 11:21, Peter Maydell wrote:
@@ -145,11 +153,8 @@ static int ich_highest_active_virt_prio(GICv3CPUState *cs)
       * in the ICH Active Priority Registers.
       */
      int i;
-    int aprmax = 1 << (cs->vprebits - 5);
- assert(aprmax <= ARRAY_SIZE(cs->ich_apr[0]));
-
-    for (i = 0; i < aprmax; i++) {
+    for (i = 0; i < ich_num_aprs(cs); i++) {

Better to retain the local variable for the loop bound.


r~

Reply via email to