public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: John Garry <john.g.garry@oracle.com>
Cc: brauner@kernel.org, linux-xfs@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iomap: Minor code simplification in iomap_dio_bio_iter()
Date: Mon, 24 Feb 2025 12:39:53 -0800	[thread overview]
Message-ID: <20250224203953.GM21808@frogsfrogsfrogs> (raw)
In-Reply-To: <20250224154538.548028-1-john.g.garry@oracle.com>

On Mon, Feb 24, 2025 at 03:45:38PM +0000, John Garry wrote:
> Combine 'else' and 'if' conditional statements onto a single line and drop
> unrequired braces, as is standard coding style.
> 
> The code had been like this since commit c3b0e880bbfa ("iomap: support
> REQ_OP_ZONE_APPEND").
> 
> Signed-off-by: John Garry <john.g.garry@oracle.com>

Looks fine to me,
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> 
> diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c
> index 138d246ec29d..cdcd5ff399c1 100644
> --- a/fs/iomap/direct-io.c
> +++ b/fs/iomap/direct-io.c
> @@ -473,12 +473,10 @@ static loff_t iomap_dio_bio_iter(const struct iomap_iter *iter,
>  			bio_put(bio);
>  			goto zero_tail;
>  		}
> -		if (dio->flags & IOMAP_DIO_WRITE) {
> +		if (dio->flags & IOMAP_DIO_WRITE)
>  			task_io_account_write(n);
> -		} else {
> -			if (dio->flags & IOMAP_DIO_DIRTY)
> -				bio_set_pages_dirty(bio);
> -		}
> +		else if (dio->flags & IOMAP_DIO_DIRTY)
> +			bio_set_pages_dirty(bio);
>  
>  		dio->size += n;
>  		copied += n;
> -- 
> 2.31.1
> 
> 

  reply	other threads:[~2025-02-24 20:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-24 15:45 [PATCH] iomap: Minor code simplification in iomap_dio_bio_iter() John Garry
2025-02-24 20:39 ` Darrick J. Wong [this message]
2025-02-25 10:55 ` Christian Brauner

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=20250224203953.GM21808@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=brauner@kernel.org \
    --cc=john.g.garry@oracle.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox