Daniel Walker wrote:
>
> Add back copyrights, documentation, and function descriptions.
Thank you for doing that!
> + * This is a priority-sorted list of nodes; each node has a >= 0
> + * priority from 0 (highest) to INT_MAX (lowest).
Why >= 0 ? ->prio is just integer, it can be < 0.
The list itself has
> + * a priority too (the highest of all the nodes), stored in the head
> + * of the list (that is a node itself).
No, the head is not a node, and does not have ->prio field. It is easy
to get plist's priority:
plist_empty(head) ? INT_MAX // or 0?
: plist_last(head)->prio
> + * INT_MIN is the highest priority, 0 is the medium highest, INT_MAX
> + * is lowest priority.
This is right, but contradicts with 'each node has a >= 0 priority' above.
Actually I don't understand why should we talk about min/max at all.
plist is sorted by ->prio which is integer. That's all.
> + * plist_add - add @node to @head returns !0 if the plist prio changed, 0
> + * otherwise. XXX: Fix return code.
> + *
> + * @node: &struct pl_node pointer
> + * @head: &struct pl_head pointer
> + */
> void plist_add(struct pl_node *node, struct pl_head *head)
> {
> struct pl_node *iter;
> @@ -25,6 +48,12 @@ eq_prio:
> list_add_tail(&node->plist.node_list, &iter->plist.node_list);
> }
> +/**
> + * plist_del - Remove a @node from plist. returns !0 if the plist prio
> + * changed, 0 otherwise. XXX: Fix return code.
> + *
> + * @node: &struct pl_node pointer
> + */
> void plist_del(struct pl_node *node)
> {
> if (!list_empty(&node->plist.prio_list)) {
Both of them have 'void' return type.
Oleg.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]