diff mbox series

[13/14] iomap: cleanup iomap_ioend_compare

Message ID 20191017175624.30305-14-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [01/14] iomap: iomap that extends beyond EOF should be marked dirty | expand

Commit Message

Christoph Hellwig Oct. 17, 2019, 5:56 p.m. UTC
Move the initialization of ia and ib to the declaration line and remove
a superflous else.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/iomap/buffered-io.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index f8ff96124a86..bb96499c352f 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -1226,13 +1226,12 @@  EXPORT_SYMBOL_GPL(iomap_ioend_try_merge);
 static int
 iomap_ioend_compare(void *priv, struct list_head *a, struct list_head *b)
 {
-	struct iomap_ioend *ia, *ib;
+	struct iomap_ioend *ia = container_of(a, struct iomap_ioend, io_list);
+	struct iomap_ioend *ib = container_of(b, struct iomap_ioend, io_list);
 
-	ia = container_of(a, struct iomap_ioend, io_list);
-	ib = container_of(b, struct iomap_ioend, io_list);
 	if (ia->io_offset < ib->io_offset)
 		return -1;
-	else if (ia->io_offset > ib->io_offset)
+	if (ia->io_offset > ib->io_offset)
 		return 1;
 	return 0;
 }