public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Kernel development list <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@redhat.com>, Andrew Morton <akpm@osdl.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Kai Petzke <wpp@marie.physik.tu-berlin.de>,
	"Theodore Ts'o" <tytso@mit.edu>
Subject: Re: Complaint about return code convention in queue_work() etc.
Date: Fri, 18 Aug 2006 17:43:18 -0400	[thread overview]
Message-ID: <44E63476.201@garzik.org> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0608181730510.5732-100000@iolanthe.rowland.org>

Alan Stern wrote:
> I'd like to lodge a bitter complaint about the return codes used by 
> queue_work() and related functions:
> 
> 	Why do the damn things return 0 for error and 1 for success???
> 	Why don't they use negative error codes for failure, like 
> 	everything else in the kernel?!!

It's a standard programming idiom:  return false (0) for failure, true 
(non-zero) for success.  Boolean.

Certainly the kernel often uses the -errno convention, but it's not a rule.

	Jeff




  reply	other threads:[~2006-08-18 21:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-18 21:39 Complaint about return code convention in queue_work() etc Alan Stern
2006-08-18 21:43 ` Jeff Garzik [this message]
2006-08-18 22:41   ` Andrew Morton
2006-08-18 23:29   ` Alexey Dobriyan
2006-08-19 15:24     ` Alan Stern
2006-08-20  8:27       ` Jan Engelhardt
2006-08-20 16:58         ` Alan Stern
2006-08-20 22:06           ` Jan Engelhardt
2006-08-20 22:36             ` Alan Stern
2006-08-20 11:06 ` Ingo Molnar

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=44E63476.201@garzik.org \
    --to=jeff@garzik.org \
    --cc=akpm@osdl.org \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=stern@rowland.harvard.edu \
    --cc=tytso@mit.edu \
    --cc=wpp@marie.physik.tu-berlin.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