Adjust so we uniformly avoid needlessly arranging for a continuation on
the last iteration.
Fixes: 5777a3742d88 ("IOMMU: hold page ref until after deferred TLB flush")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
++extra.ppage;
/* Check for continuation if it's not the last iteration. */
- if ( (++done >= ARRAY_SIZE(pages) && extra.ppage) ||
- (xatp->size > done && hypercall_preempt_check()) )
+ if ( xatp->size > ++done &&
+ ((done >= ARRAY_SIZE(pages) && extra.ppage) ||
+ hypercall_preempt_check()) )
{
rc = start + done;
break;