/* We spread the allocation around to reduce the possibility of two consecutive opened @neh's getting the same context ID assigned (to avoid surprises with late events that timed out long time ago). So first we search from where @rc->ctx_roll is, if not found, we search from zero.  */
static int __uwb_rc_ctx_get(struct uwb_rc *rc, struct uwb_rc_neh *neh)
/* We spread the allocation around to reduce the possibility of two consecutive opened @neh's getting the same context ID assigned (to avoid surprises with late events that timed out long time ago). So first we search from where @rc->ctx_roll is, if not found, we search from zero.  */
static int __uwb_rc_ctx_get(struct uwb_rc *rc, struct uwb_rc_neh *neh)
{
	int result;
	result = find_next_zero_bit(rc->ctx_bm, UWB_RC_CTX_MAX,
				    rc->ctx_roll++);
	if (result < UWB_RC_CTX_MAX)
		goto found;
	result = find_first_zero_bit(rc->ctx_bm, UWB_RC_CTX_MAX);
	if (result < UWB_RC_CTX_MAX)
		goto found;
	return -ENFILE;
found:
	set_bit(result, rc->ctx_bm);
	neh->context = result;
	return 0;
}