From: Gu Zheng Date: Thu, 3 Apr 2014 21:47:16 +0000 (-0700) Subject: fs/direct-io.c: remove redundant comparison X-Git-Tag: firefly_0821_release~176^2~4160^2~186 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2b665e276c15ba7d9fc8cdd16931883a51ed13e4;p=firefly-linux-kernel-4.4.55.git fs/direct-io.c: remove redundant comparison The return value of bio_get_nr_vecs() cannot be bigger than BIO_MAX_PAGES, so we can remove redundant the comparison between nr_pages and BIO_MAX_PAGES. Signed-off-by: Gu Zheng Cc: Al Viro Reviewed-by: Jeff Moyer Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/direct-io.c b/fs/direct-io.c index 160a5489a939..6e6bff375244 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -664,7 +664,6 @@ static inline int dio_new_bio(struct dio *dio, struct dio_submit *sdio, goto out; sector = start_sector << (sdio->blkbits - 9); nr_pages = min(sdio->pages_in_io, bio_get_nr_vecs(map_bh->b_bdev)); - nr_pages = min(nr_pages, BIO_MAX_PAGES); BUG_ON(nr_pages <= 0); dio_bio_alloc(dio, sdio, map_bh->b_bdev, sector, nr_pages); sdio->boundary = 0;