f2fs: remove unnecessary condition checks
authorJaegeuk Kim <jaegeuk.kim@samsung.com>
Thu, 28 Nov 2013 03:55:13 +0000 (12:55 +0900)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Mon, 23 Dec 2013 01:18:04 +0000 (10:18 +0900)
This patch removes the unnecessary condition checks on:

fs/f2fs/gc.c:667 do_garbage_collect() warn: 'sum_page' isn't an ERR_PTR
fs/f2fs/f2fs.h:795 f2fs_put_page() warn: 'page' isn't an ERR_PTR

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
fs/f2fs/f2fs.h
fs/f2fs/gc.c

index 1f1bc58d50ed3f494a651dff2c504da3d8f1d82e..9a76c83937b146a042f24dbf97699b7a174db206 100644 (file)
@@ -792,7 +792,7 @@ static inline unsigned int valid_inode_count(struct f2fs_sb_info *sbi)
 
 static inline void f2fs_put_page(struct page *page, int unlock)
 {
-       if (!page || IS_ERR(page))
+       if (!page)
                return;
 
        if (unlock) {
index b7ad1ec7e4ccb50227d1b48ce6d9ee7d26796f07..5fa54c1ca33baa94c3cc3c55b87a1f0be26fe4b6 100644 (file)
@@ -664,8 +664,6 @@ static void do_garbage_collect(struct f2fs_sb_info *sbi, unsigned int segno,
 
        /* read segment summary of victim */
        sum_page = get_sum_page(sbi, segno);
-       if (IS_ERR(sum_page))
-               return;
 
        blk_start_plug(&plug);