Lines Matching refs:bit
201 unsigned long bit, i, flags; in airq_iv_alloc() local
206 bit = find_first_bit_inv(iv->avail, iv->bits); in airq_iv_alloc()
207 while (bit + num <= iv->bits) { in airq_iv_alloc()
209 if (!test_bit_inv(bit + i, iv->avail)) in airq_iv_alloc()
214 clear_bit_inv(bit + i, iv->avail); in airq_iv_alloc()
215 if (bit + num >= iv->end) in airq_iv_alloc()
216 iv->end = bit + num + 1; in airq_iv_alloc()
219 bit = find_next_bit_inv(iv->avail, iv->bits, bit + i + 1); in airq_iv_alloc()
221 if (bit + num > iv->bits) in airq_iv_alloc()
222 bit = -1UL; in airq_iv_alloc()
224 return bit; in airq_iv_alloc()
234 void airq_iv_free(struct airq_iv *iv, unsigned long bit, unsigned long num) in airq_iv_free() argument
243 clear_bit_inv(bit + i, iv->vector); in airq_iv_free()
245 set_bit_inv(bit + i, iv->avail); in airq_iv_free()
247 if (bit + num >= iv->end) { in airq_iv_free()
268 unsigned long bit; in airq_iv_scan() local
271 bit = find_next_bit_inv(iv->vector, end, start); in airq_iv_scan()
272 if (bit >= end) in airq_iv_scan()
274 clear_bit_inv(bit, iv->vector); in airq_iv_scan()
275 return bit; in airq_iv_scan()