Lines Matching refs:bit
225 unsigned long bit, i, flags; in airq_iv_alloc() local
230 bit = find_first_bit_inv(iv->avail, iv->bits); in airq_iv_alloc()
231 while (bit + num <= iv->bits) { in airq_iv_alloc()
233 if (!test_bit_inv(bit + i, iv->avail)) in airq_iv_alloc()
238 clear_bit_inv(bit + i, iv->avail); in airq_iv_alloc()
239 if (bit + num >= iv->end) in airq_iv_alloc()
240 iv->end = bit + num + 1; in airq_iv_alloc()
243 bit = find_next_bit_inv(iv->avail, iv->bits, bit + i + 1); in airq_iv_alloc()
245 if (bit + num > iv->bits) in airq_iv_alloc()
246 bit = -1UL; in airq_iv_alloc()
248 return bit; in airq_iv_alloc()
258 void airq_iv_free(struct airq_iv *iv, unsigned long bit, unsigned long num) in airq_iv_free() argument
267 clear_bit_inv(bit + i, iv->vector); in airq_iv_free()
269 set_bit_inv(bit + i, iv->avail); in airq_iv_free()
271 if (bit + num >= iv->end) { in airq_iv_free()
292 unsigned long bit; in airq_iv_scan() local
295 bit = find_next_bit_inv(iv->vector, end, start); in airq_iv_scan()
296 if (bit >= end) in airq_iv_scan()
298 clear_bit_inv(bit, iv->vector); in airq_iv_scan()
299 return bit; in airq_iv_scan()