mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 05:44:11 +00:00
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: Matthew Wilcox (Oracle) <willy@infradead.org>
This commit is contained in:
parent
cf948cbc35
commit
8b5d143c95
1 changed files with 1 additions and 2 deletions
|
@ -718,8 +718,7 @@ void *read_part_sector(struct parsed_partitions *state, sector_t n, Sector *p)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
p->v = page;
|
p->v = page;
|
||||||
return (unsigned char *)page_address(page) +
|
return page_address(page) + offset_in_page(n * SECTOR_SIZE);
|
||||||
((n & ((1 << (PAGE_SHIFT - 9)) - 1)) << SECTOR_SHIFT);
|
|
||||||
out:
|
out:
|
||||||
p->v = NULL;
|
p->v = NULL;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in a new issue