From: Christoph Hellwig Date: Thu, 17 Oct 2019 20:12:20 +0000 (-0700) Subject: iomap: cleanup iomap_ioend_compare X-Git-Tag: v5.10.7~3671^2~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b3d423ec898ae27007a9c49915ac06a2f50b404f;p=platform%2Fkernel%2Flinux-rpi.git iomap: cleanup iomap_ioend_compare Move the initialization of ia and ib to the declaration line and remove a superflous else. Signed-off-by: Christoph Hellwig Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index b5ff54f..529a759 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; }