s = roundup_pow_of_two(size);  j = i; 
i = fls(size - 1); s = 1 << i; j = i -= ALLOC_MIN_SHIFT; 
unsigned long gen_pool_alloc(struct gen_pool *poolp, int size){	int j, i, s, max_chunk_size;	unsigned long a, flags;	struct gen_pool_link *h = poolp->h;	max_chunk_size = 1 << poolp->max_chunk_shift;	if (size > max_chunk_size)		return 0;	i = 0;	size = max(size, 1 << ALLOC_MIN_SHIFT);	s = roundup_pow_of_two(size);	j = i;	spin_lock_irqsave(&poolp->lock, flags);	while (!h[j].next) {		if (s == max_chunk_size) {			struct gen_pool_link *ptr;			spin_unlock_irqrestore(&poolp->lock, flags);			ptr = (struct gen_pool_link *)poolp->get_new_chunk(poolp);			spin_lock_irqsave(&poolp->lock, flags);			h[j].next = ptr;			if (h[j].next)				h[j].next->next = NULL;			break;		}		j++;		s <<= 1;	}	a = (unsigned long) h[j].next;	if (a) {		h[j].next = h[j].next->next;		/*		 * This should be split into a seperate function doing		 * the chunk split in order to support custom		 * handling memory not physically accessible by host		 */		while (j > i) {			j -= 1;			s >>= 1;			h[j].next = (struct gen_pool_link *) (a + s);			h[j].next->next = NULL;		}	}	spin_unlock_irqrestore(&poolp->lock, flags);	return a;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/46596338a10a54550ff03a6f60c28145a080296b/genalloc.c/buggy/lib/genalloc.c