break;
}
if (likely(atomic_read(&map->nr_free))) {
- do {
+ for ( ; ; ) {
if (!test_and_set_bit(offset, map->page)) {
atomic_dec(&map->nr_free);
set_last_pid(pid_ns, last, pid);
return pid;
}
offset = find_next_offset(map, offset);
- } while (offset < BITS_PER_PAGE &&
- (pid = mk_pid(pid_ns, map, offset)) < pid_max);
+ if (offset >= BITS_PER_PAGE)
+ break;
+ pid = mk_pid(pid_ns, map, offset);
+ if (pid >= pid_max)
+ break;
+ }
}
if (map < &pid_ns->pidmap[(pid_max-1)/BITS_PER_PAGE]) {
++map;