lkml.org 
[lkml]   [2015]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 1/3] lib/plist: Provide plist_add_head() for nodes with the same prio
On Mon, 20 Apr 2015 16:22:46 +0800
Xunlei Pang <xlpang@126.com> wrote:

> +/**
> + * plist_add_tail - add @node to @head, after all existing same-prio nodes
> + *
> + * @node: The plist_node to be added to @head
> + * @head: The plist_head that @node is being added to
> + */
> +static inline
> +void plist_add_tail(struct plist_node *node, struct plist_head *head)
> +{
> + __plist_add(node, head, false);
> +}
> +
> +#define plist_add plist_add_tail

I already placed my review by, but this is more of a matter of taste.

I don't think this should be a #define, but instead a static inline.
The assembly will end up as the same, but the compiler warnings will be
more helpful if it is a static inline, as we don't want
"plist_add_tail()" being shown in warnings when the developer never
typed in "_tail()".

Thus it should be:

static inline void
plist_add(struct plist_node *node, struct plist_head *head)
{
plist_add_tail(node, head);
}

You can keep my Reviewed-by, but please make this update.

-- Steve


> +
> extern void plist_del(struct plist_node *node, struct plist_head *head);
>
> extern void plist_requeue(struct plist_node *node, struct plist_head *head);
> diff --git a/lib/plist.c b/lib/plist.c
> index 3a30c53..c1ee2b0 100644
> --- a/lib/plist.c
> +++ b/lib/plist.c



\
 
 \ /
  Last update: 2015-04-20 17:01    [W:0.085 / U:2.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site