All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dtor@insightbb.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: linux-kernel@vger.kernel.org
Subject: Re: functions returning 0 on success [was: [PATCH] Fix a memory leak in the i386 setup code]
Date: Sat, 15 Jul 2006 13:33:16 -0400	[thread overview]
Message-ID: <200607151333.16817.dtor@insightbb.com> (raw)
In-Reply-To: <44B2D893.9050209@tls.msk.ru>

On Monday 10 July 2006 18:45, Michael Tokarev wrote:
> In such cases when a routine returns 0 on error, I usually write
> it this way:
> 
>    if (request_resource() != 0)
>      fail()
> 


Many write:

	error = do_something();
	if (error) {
		...
	}

And then it really obvious.

-- 
Dmitry

      parent reply	other threads:[~2006-07-15 17:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-10 22:13 [PATCH] Fix a memory leak in the i386 setup code Catalin Marinas
2006-07-10 22:25 ` Rafael J. Wysocki
2006-07-11  7:47   ` Catalin Marinas
2006-07-11  8:26     ` Rafael J. Wysocki
2006-07-10 22:45 ` functions returning 0 on success [was: [PATCH] Fix a memory leak in the i386 setup code] Michael Tokarev
2006-07-10 22:49   ` Michael Tokarev
2006-07-15 17:33   ` Dmitry Torokhov [this message]

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=200607151333.16817.dtor@insightbb.com \
    --to=dtor@insightbb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjt@tls.msk.ru \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.