lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1548423288-4225-1-git-send-email-liu.xiang6@zte.com.cn>
Date:   Fri, 25 Jan 2019 21:34:48 +0800
From:   Liu Xiang <liu.xiang6@....com.cn>
To:     linux-mm@...ck.org
Cc:     linux-kernel@...r.kernel.org, liuxiang_1999@....com,
        Liu Xiang <liu.xiang6@....com.cn>
Subject: [PATCH] mm/filemap.c: Simplify the calculation of ra->prev_pos

The calculation of ra->prev_pos can be simplified.

Signed-off-by: Liu Xiang <liu.xiang6@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ