Re: [PATCH][2.5] Single linked headed lists for Linux, v3

Thunder from the hill (thunder@lightweight.ods.org)
Sat, 28 Sep 2002 03:52:48 -0600 (MDT)


Hi,

On Sat, 28 Sep 2002, Lightweight Patch Manager wrote:
> +/**
> + * slist_del_init - remove an entry from list and initialize it
> + * @head: head to remove it from
> + * @entry: entry to be removed
> + */
> +#define slist_del_init(_entry_in) \
> +({ \
> + typeof(_entry_in) _entry = (_entry_in), _head = \
> + kmalloc(sizeof(_entry), GFP_KERNEL), _free; \
> + if (_head) { \
> + memcpy(_head, (_entry), sizeof(_entry)); \
> + _free = (_entry); \
> + (_entry) = (_entry)->next; \
> + kfree(_free); \
> + _head->next = _head; \
> + _head; \
> + } else \
> + NULL; \
> +})

Forget this piece...

Thunder

-- 
assert(typeof((fool)->next) == typeof(fool));	/* wrong */

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/