lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Fri, 27 Oct 2006 11:28:09 -0400 (EDT)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Andrew Morton <akpm@...l.org>
cc:	Ingo Molnar <mingo@...hat.com>,
	David Woodhouse <dwmw2@...radead.org>,
	Theodore Ts'o <tytso@....edu>,
	Kernel development list <linux-kernel@...r.kernel.org>
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@...land.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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ