btrfs: kmap() can't fail
authorFabian Frederick <fabf@skynet.be>
Tue, 25 Apr 2017 18:11:02 +0000 (20:11 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Jun 2017 16:25:57 +0000 (18:25 +0200)
Remove NULL test on kmap() as it will always return a valid pointer.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/check-integrity.c

index ab14c2e635ca9bc5a0c61330bbd6f7ade04af18c..496eb009c41dd68d4a9c748ca33b44b7f99a6651 100644 (file)
@@ -1668,14 +1668,8 @@ static int btrfsic_read_block(struct btrfsic_state *state,
                dev_bytenr += (j - i) * PAGE_SIZE;
                i = j;
        }
-       for (i = 0; i < num_pages; i++) {
+       for (i = 0; i < num_pages; i++)
                block_ctx->datav[i] = kmap(block_ctx->pagev[i]);
-               if (!block_ctx->datav[i]) {
-                       pr_info("btrfsic: kmap() failed (dev %s)!\n",
-                              block_ctx->dev->name);
-                       return -1;
-               }
-       }
 
        return block_ctx->len;
 }