Commit 8b5d143c authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle)
Browse files

block: Simplify read_part_sector()



That rather complicated expression is just trying to find the offset
of this sector within a page, and there are easier ways to express that.

Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
parent cf948cbc
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -718,8 +718,7 @@ void *read_part_sector(struct parsed_partitions *state, sector_t n, Sector *p)
		goto out;

	p->v = page;
	return (unsigned char *)page_address(page) +
			((n & ((1 << (PAGE_SHIFT - 9)) - 1)) << SECTOR_SHIFT);
	return page_address(page) + offset_in_page(n * SECTOR_SIZE);
out:
	p->v = NULL;
	return NULL;