linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/filemap.c: Simplify the calculation of ra->prev_pos
@ 2019-01-25 13:34 Liu Xiang
  0 siblings, 0 replies; only message in thread
From: Liu Xiang @ 2019-01-25 13:34 UTC (permalink / raw)
  To: linux-mm; +Cc: linux-kernel, liuxiang_1999, Liu Xiang

The calculation of ra->prev_pos can be simplified.

Signed-off-by: Liu Xiang <liu.xiang6@zte.com.cn>
---
 mm/filemap.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index 9f5e323..7f30844 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2279,9 +2279,7 @@ static ssize_t generic_file_buffered_read(struct kiocb *iocb,
 would_block:
 	error = -EAGAIN;
 out:
-	ra->prev_pos = prev_index;
-	ra->prev_pos <<= PAGE_SHIFT;
-	ra->prev_pos |= prev_offset;
+	ra->prev_pos = (prev_index << PAGE_SHIFT) | prev_offset;
 
 	*ppos = ((loff_t)index << PAGE_SHIFT) + offset;
 	file_accessed(filp);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-01-25 13:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-25 13:34 [PATCH] mm/filemap.c: Simplify the calculation of ra->prev_pos Liu Xiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).