lkml.org 
[lkml]   [2006]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] workqueue: update kerneldoc
This patch (as812) changes the kerneldoc comments explaining the
return values from queue_work(), queue_delayed_work(), and
queue_delayed_work_on(). The updated comments explain more
accurately the meaning of the return code and avoid suggesting that a
0 value means the routine was unsuccessful.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>

---

Andrew:

After seeing how queue_work() and schedule_work() are used in practice,
and in view of the recent discussion (concerning the PCI MWI routine)
about when it's appropriate to return an error code as opposed to just
returning a non-zero value, I decided there wasn't any need to change
queue_work() and friends.

The 0 value they return is not a sign of an error; it simply means
that the work_struct had already been added to a workqueue. The best way
to clear up any confusion is simply to improve the kerneldoc comment.

Alan Stern


Index: usb-2.6/kernel/workqueue.c
===================================================================
--- usb-2.6.orig/kernel/workqueue.c
+++ usb-2.6/kernel/workqueue.c
@@ -99,7 +99,7 @@ static void __queue_work(struct cpu_work
* @wq: workqueue to use
* @work: work to queue
*
- * Returns non-zero if it was successfully added.
+ * Returns 0 if @work was already on a queue, non-zero otherwise.
*
* We queue the work to the CPU it was submitted, but there is no
* guarantee that it will be processed by that CPU.
@@ -138,7 +138,7 @@ void delayed_work_timer_fn(unsigned long
* @work: work to queue
* @delay: number of jiffies to wait before queueing
*
- * Returns non-zero if it was successfully added.
+ * Returns 0 if @work was already on a queue, non-zero otherwise.
*/
int fastcall queue_delayed_work(struct workqueue_struct *wq,
struct work_struct *work, unsigned long delay)
@@ -170,7 +170,7 @@ EXPORT_SYMBOL_GPL(queue_delayed_work);
* @work: work to queue
* @delay: number of jiffies to wait before queueing
*
- * Returns non-zero if it was successfully added.
+ * Returns 0 if @work was already on a queue, non-zero otherwise.
*/
int queue_delayed_work_on(int cpu, struct workqueue_struct *wq,
struct work_struct *work, unsigned long delay)
-
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-10-27 17:31    [W:0.092 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site