]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
iomap: cleanup iomap_ioend_compare
authorChristoph Hellwig <hch@lst.de>
Thu, 17 Oct 2019 20:12:20 +0000 (13:12 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 21 Oct 2019 15:51:59 +0000 (08:51 -0700)
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>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/iomap/buffered-io.c

index b5ff54fddf1f60a996047bf494c83e5bc9568ab9..529a759c5f9bebf96c321d5d7fc06e8effe5e615 100644 (file)
@@ -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;
 }