From: Oleg Nesterov <oleg@tv-sign.ru>
To: Daniel Walker <dwalker@mvista.com>
Cc: mingo@elte.hu, tglx@linutronix.de,
inaky.perez-gonzalez@intel.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 01/02] RT: add back plist docs
Date: Thu, 22 Dec 2005 17:37:29 +0300 [thread overview]
Message-ID: <43AABA29.6948B18B@tv-sign.ru> (raw)
In-Reply-To: 1135202200.22970.12.camel@localhost.localdomain
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.
next prev parent reply other threads:[~2005-12-22 13:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-21 21:56 [PATCH 01/02] RT: add back plist docs Daniel Walker
2005-12-22 14:37 ` Oleg Nesterov [this message]
2005-12-21 23:15 Perez-Gonzalez, Inaky
2005-12-22 14:43 ` Oleg Nesterov
2005-12-22 14:33 ` Pekka Enberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43AABA29.6948B18B@tv-sign.ru \
--to=oleg@tv-sign.ru \
--cc=dwalker@mvista.com \
--cc=inaky.perez-gonzalez@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).