On Thu, Apr 18, 2024 at 10:23:14AM -0600, Alex Williamson wrote: > > yep. maybe we can start with the below code, no need for ida_for_each() > > today. > > > > > > int id = 0; > > > > while (!ida_is_empty(&pasid_ida)) { > > id = ida_find_first_range(pasid_ida, id, INT_MAX); > > You've actually already justified the _min function here: > > static inline int ida_find_first_min(struct ida *ida, unsigned int min) > { > return ida_find_first_range(ida, min, ~0); > } It should also always start from 0.. Ideally written more like: while ((id = ida_find_first(pasid_ida)) != EMPTY_IDA) { ida_remove(id); } Jason