All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Jan Kara <jack@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	linux-ext4@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] ext3: remove unneeded check in ext3_ordered_writepage()
Date: Fri, 21 Feb 2014 09:08:09 +0000	[thread overview]
Message-ID: <20140221090809.GA12506@quack.suse.cz> (raw)
In-Reply-To: <20140221085854.GC13185@elgon.mountain>

On Fri 21-02-14 11:58:54, Dan Carpenter wrote:
> We already know "ret" is zero so there is no need to do:
> 
> 		if (!ret)
> 			ret = err;
> 
> We can just assign ret directly instead.
  Thanks. I've added the patch to my tree.

								Honza

> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
> index 384b6ebb655f..491f022c476a 100644
> --- a/fs/ext3/inode.c
> +++ b/fs/ext3/inode.c
> @@ -1673,12 +1673,9 @@ static int ext3_ordered_writepage(struct page *page,
>  	 * block_write_full_page() succeeded.  Otherwise they are unmapped,
>  	 * and generally junk.
>  	 */
> -	if (ret = 0) {
> -		err = walk_page_buffers(handle, page_bufs, 0, PAGE_CACHE_SIZE,
> +	if (ret = 0)
> +		ret = walk_page_buffers(handle, page_bufs, 0, PAGE_CACHE_SIZE,
>  					NULL, journal_dirty_data_fn);
> -		if (!ret)
> -			ret = err;
> -	}
>  	walk_page_buffers(handle, page_bufs, 0,
>  			PAGE_CACHE_SIZE, NULL, bput_one);
>  	err = ext3_journal_stop(handle);
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

WARNING: multiple messages have this Message-ID (diff)
From: Jan Kara <jack@suse.cz>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Jan Kara <jack@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	linux-ext4@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] ext3: remove unneeded check in ext3_ordered_writepage()
Date: Fri, 21 Feb 2014 10:08:09 +0100	[thread overview]
Message-ID: <20140221090809.GA12506@quack.suse.cz> (raw)
In-Reply-To: <20140221085854.GC13185@elgon.mountain>

On Fri 21-02-14 11:58:54, Dan Carpenter wrote:
> We already know "ret" is zero so there is no need to do:
> 
> 		if (!ret)
> 			ret = err;
> 
> We can just assign ret directly instead.
  Thanks. I've added the patch to my tree.

								Honza

> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
> index 384b6ebb655f..491f022c476a 100644
> --- a/fs/ext3/inode.c
> +++ b/fs/ext3/inode.c
> @@ -1673,12 +1673,9 @@ static int ext3_ordered_writepage(struct page *page,
>  	 * block_write_full_page() succeeded.  Otherwise they are unmapped,
>  	 * and generally junk.
>  	 */
> -	if (ret == 0) {
> -		err = walk_page_buffers(handle, page_bufs, 0, PAGE_CACHE_SIZE,
> +	if (ret == 0)
> +		ret = walk_page_buffers(handle, page_bufs, 0, PAGE_CACHE_SIZE,
>  					NULL, journal_dirty_data_fn);
> -		if (!ret)
> -			ret = err;
> -	}
>  	walk_page_buffers(handle, page_bufs, 0,
>  			PAGE_CACHE_SIZE, NULL, bput_one);
>  	err = ext3_journal_stop(handle);
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2014-02-21  9:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-21  8:58 [patch] ext3: remove unneeded check in ext3_ordered_writepage() Dan Carpenter
2014-02-21  8:58 ` Dan Carpenter
2014-02-21  9:08 ` Jan Kara [this message]
2014-02-21  9:08   ` Jan Kara

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=20140221090809.GA12506@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=adilger.kernel@dilger.ca \
    --cc=akpm@linux-foundation.org \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    /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.