linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Namhyung Kim <namhyung@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Jan Kara <jack@suse.cz>,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] jbd: Simplify return path of journal_init_common()
Date: Mon, 4 Oct 2010 11:47:47 +0200	[thread overview]
Message-ID: <20101004094747.GD3589@quack.suse.cz> (raw)
In-Reply-To: <1286171398-3479-1-git-send-email-namhyung@gmail.com>

On Mon 04-10-10 14:49:58, Namhyung Kim wrote:
> Signed-off-by: Namhyung Kim <namhyung@gmail.com>
> ---
>  fs/jbd/journal.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
> index 2c4b1f1..6f20a75 100644
> --- a/fs/jbd/journal.c
> +++ b/fs/jbd/journal.c
> @@ -698,7 +698,7 @@ static journal_t * journal_init_common (void)
>  
>  	journal = kzalloc(sizeof(*journal), GFP_KERNEL);
>  	if (!journal)
> -		goto fail;
> +		goto out;
>  
>  	init_waitqueue_head(&journal->j_wait_transaction_locked);
>  	init_waitqueue_head(&journal->j_wait_logspace);
> @@ -721,11 +721,10 @@ static journal_t * journal_init_common (void)
>  	err = journal_init_revoke(journal, JOURNAL_REVOKE_DEFAULT_HASH);
>  	if (err) {
>  		kfree(journal);
> -		goto fail;
> +		journal = NULL;
>  	}
> +out:
>  	return journal;
> -fail:
> -	return NULL;
  If you want to do something like this (but frankly I'm not so convinced
that the cleanup is worth the code churn), then just do directly
"return NULL". The function is simple enough... Thanks.

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

      reply	other threads:[~2010-10-04  9:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-04  5:49 [PATCH] jbd: Simplify return path of journal_init_common() Namhyung Kim
2010-10-04  9:47 ` Jan Kara [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=20101004094747.GD3589@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@gmail.com \
    /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).