lkml.org 
[lkml]   [2006]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [RFC/PATCH] Introduce list_get() and list_get_tail()
    Date
    Am Saturday 08 July 2006 07:24 schrieb Dmitry Torokhov:
    > +/**
    > + * list_get - get first element in a list
    > + * @head: the head of your list
    > + */
    > +static inline struct list_head *list_get(struct list_head *head)
    > +{
    > +       return head->next;
    > +}

    I would expect it to be more useful when combined with list_entry(),
    something like

    #define list_first_entry(list, type, member) \
    container_of((list)->next, type, member)
    #define list_last_entry(list, type, member) \
    container_of((list)->prev, type, member)

    Arnd <><
    -
    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/

    \
     
     \ /
      Last update: 2006-07-08 20:33    [W:0.029 / U:29.644 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site