diff mbox series

[01/24] block: Remove check of PageError

Message ID 20220527155036.524743-2-willy@infradead.org (mailing list archive)
State New
Headers show
Series Begin removing PageError | expand

Commit Message

Matthew Wilcox May 27, 2022, 3:50 p.m. UTC
If read_mapping_page() sees a page with PageError set, it returns a
PTR_ERR().  Checking PageError again is simply dead code.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 block/partitions/core.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Christoph Hellwig May 28, 2022, 5:47 a.m. UTC | #1
On Fri, May 27, 2022 at 04:50:13PM +0100, Matthew Wilcox (Oracle) wrote:
> If read_mapping_page() sees a page with PageError set, it returns a
> PTR_ERR().  Checking PageError again is simply dead code.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/block/partitions/core.c b/block/partitions/core.c
index 8a0ec929023b..a9a51bac42df 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -716,14 +716,10 @@  void *read_part_sector(struct parsed_partitions *state, sector_t n, Sector *p)
 			(pgoff_t)(n >> (PAGE_SHIFT - 9)), NULL);
 	if (IS_ERR(page))
 		goto out;
-	if (PageError(page))
-		goto out_put_page;
 
 	p->v = page;
 	return (unsigned char *)page_address(page) +
 			((n & ((1 << (PAGE_SHIFT - 9)) - 1)) << SECTOR_SHIFT);
-out_put_page:
-	put_page(page);
 out:
 	p->v = NULL;
 	return NULL;