Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp469250imu; Fri, 25 Jan 2019 05:35:33 -0800 (PST) X-Google-Smtp-Source: ALg8bN42iSVcqcpcus4liHtLMKWh7t/bZQRbjS/LG+tD1GxeAjSHPabkPmbl5Kf29xMK1sKMmPXh X-Received: by 2002:a17:902:8641:: with SMTP id y1mr10985436plt.159.1548423333208; Fri, 25 Jan 2019 05:35:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548423333; cv=none; d=google.com; s=arc-20160816; b=t+2CZrr6/b7+R8QP+3VH33rqPFRWuAueJwlYUEl/KK2FkyOYSFhjAT1Uc0V+1ofC8L G3uDFfSV/2sh+6UUlVa7PjGWHYuc3Oo/qt/bFvuLEhmFZfKwQOfD+CIGGNBfe6z05jRC R2Lrl0oF2EDJQ3fVqKwCyKYB3ANxdCLpkSnTmrGssWY6UTNZmsq35uXkWyD91bRHAQ9T AFWxCIVHFo6GTDs3jW3WudjXLV+futP/1tTcgMsZV7aRoBjz5ux2YlqgT9xMGOIlTyEf PItA5IAeRESjyH5vHV+uZKUZo7CQMdEfXEvDhw3FPSZh5jkJzBTO4zEzkXXO+EDsgeNE qFQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=py+iQAic6GWLUw+AC3zhucf7qL4NKz9GkhK48UkXXTs=; b=HrA2NfUOmOhpHFqJKfSzoIMFh067vsNF38WoYQ//LsImNdujARaY7rIUe29LVYodFi SrCU6cJr6F69Bfc1kVzf4jaNpeWV5G9gIEGYEwgMEQgkslygktNNfGVTb5Db6SzKb6yP NROrayiXFd3J5R8UT+UUIBVvrHgWwGe4Uvezp+sOLmLIvOPYr1nQWA72qM6UqW+roWJ6 d9Le6mWtXob+xQ0ac/oSlUCHsYLZ/0b+HNtm9TvNJdgFGX1DVPgi2zPzuHk6ERS3M2bf pKjz8CcEo4CVdTiiMHVNI6DicXMnkT9liezcJbwD75M+kxiOFhVTcfDmW4nLy2N+VRPm F/TQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i198si683348pfe.289.2019.01.25.05.35.17; Fri, 25 Jan 2019 05:35:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727882AbfAYNfN (ORCPT + 99 others); Fri, 25 Jan 2019 08:35:13 -0500 Received: from smtprz14.163.net ([106.3.154.247]:45344 "EHLO smtp.tom.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726095AbfAYNfN (ORCPT ); Fri, 25 Jan 2019 08:35:13 -0500 Received: from 172.25.16.148 (unknown [172.25.16.148]) by freemail02.tom.com (Postfix) with ESMTP id 9A606B00DB7 for ; Fri, 25 Jan 2019 21:34:55 +0800 (CST) Received: from 172.25.16.91 (HELO smtp.tom.com) ([172.25.16.91]) by localhost (TOM SMTP Server) with SMTP ID 1938871118 for ; Fri, 25 Jan 2019 21:34:55 +0800 (CST) Received: from antispam2.tom.com (unknown [172.25.16.56]) by freemail02.tom.com (Postfix) with ESMTP id 28283B00D37 for ; Fri, 25 Jan 2019 21:34:55 +0800 (CST) Received: from antispam2.tom.com (antispam2.tom.com [127.0.0.1]) by antispam2.tom.com (Postfix) with ESMTP id 261028162E for ; Fri, 25 Jan 2019 21:34:55 +0800 (CST) X-Virus-Scanned: Debian amavisd-new at antispam2.tom.com Received: from antispam2.tom.com ([127.0.0.1]) by antispam2.tom.com (antispam2.tom.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EBdwy3wsjz6q for ; Fri, 25 Jan 2019 21:34:54 +0800 (CST) Received: from localhost (unknown [222.209.19.163]) by antispam2.tom.com (Postfix) with ESMTPA id BE7F0815E1; Fri, 25 Jan 2019 21:34:53 +0800 (CST) From: Liu Xiang To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, liuxiang_1999@126.com, Liu Xiang Subject: [PATCH] mm/filemap.c: Simplify the calculation of ra->prev_pos Date: Fri, 25 Jan 2019 21:34:48 +0800 Message-Id: <1548423288-4225-1-git-send-email-liu.xiang6@zte.com.cn> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The calculation of ra->prev_pos can be simplified. Signed-off-by: Liu Xiang --- 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