static void cas_spare_recover(struct cas *cp, const int flags) 
static void cas_spare_recover(struct cas *cp, const gfp_t flags) 
static void cas_spare_recover(struct cas *cp, const int flags){	struct list_head list, *elem, *tmp;	int needed, i;	/* check inuse list. if we don't need any more free buffers,	 * just free it	 */	/* make a local copy of the list */	INIT_LIST_HEAD(&list);	spin_lock(&cp->rx_inuse_lock);	list_splice(&cp->rx_inuse_list, &list);	INIT_LIST_HEAD(&cp->rx_inuse_list);	spin_unlock(&cp->rx_inuse_lock);		list_for_each_safe(elem, tmp, &list) {		cas_page_t *page = list_entry(elem, cas_page_t, list);		if (page_count(page->buffer) > 1) 			continue;		list_del(elem);		spin_lock(&cp->rx_spare_lock);		if (cp->rx_spares_needed > 0) {			list_add(elem, &cp->rx_spare_list);			cp->rx_spares_needed--;			spin_unlock(&cp->rx_spare_lock);		} else {			spin_unlock(&cp->rx_spare_lock);			cas_page_free(cp, page);		}	}	/* put any inuse buffers back on the list */	if (!list_empty(&list)) {		spin_lock(&cp->rx_inuse_lock);		list_splice(&list, &cp->rx_inuse_list);		spin_unlock(&cp->rx_inuse_lock);	}		spin_lock(&cp->rx_spare_lock);	needed = cp->rx_spares_needed;	spin_unlock(&cp->rx_spare_lock);	if (!needed)		return;	/* we still need spares, so try to allocate some */	INIT_LIST_HEAD(&list);	i = 0;	while (i < needed) {		cas_page_t *spare = cas_page_alloc(cp, flags);		if (!spare) 			break;		list_add(&spare->list, &list);		i++;	}	spin_lock(&cp->rx_spare_lock);	list_splice(&list, &cp->rx_spare_list);	cp->rx_spares_needed -= i;	spin_unlock(&cp->rx_spare_lock);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/9e24974db6b01ec067c24de09588282b6a1407f0/cassini.c/buggy/drivers/net/cassini.c