From patchwork Thu Sep 2 21:53:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12472777 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 190D4C4332F for ; Thu, 2 Sep 2021 21:53:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C32FB610CF for ; Thu, 2 Sep 2021 21:53:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C32FB610CF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 6305D6B00B5; Thu, 2 Sep 2021 17:53:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5DFF76B00B4; Thu, 2 Sep 2021 17:53:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4F6D26B00B5; Thu, 2 Sep 2021 17:53:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0147.hostedemail.com [216.40.44.147]) by kanga.kvack.org (Postfix) with ESMTP id 3BAB46B00B3 for ; Thu, 2 Sep 2021 17:53:47 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 074BB824C42F for ; Thu, 2 Sep 2021 21:53:47 +0000 (UTC) X-FDA: 78543986094.26.3C1A3BF Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf28.hostedemail.com (Postfix) with ESMTP id B5114900009A for ; Thu, 2 Sep 2021 21:53:46 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id B5F98610A2; Thu, 2 Sep 2021 21:53:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1630619626; bh=6JZSgG/1Cc6cC7JLrfjbC8YPtOtg1nVaTRX08D6/drI=; h=Date:From:To:Subject:In-Reply-To:From; b=euKJXObnoXehB1leMP7Oq2dcg39PZgmuheIcwSyUhZ0kxXuvxeYgo7Q5qWqFXsQ8i 8cR3Ce1SKlmC4/N88oZ58sptLEP/k/MlgA56To0tokyut9pbP+oNXfz/OOiE57uls2 9lXdI37FSQ9qibtBeYPA3rTb36td16vDCUx6/jHY= Date: Thu, 02 Sep 2021 14:53:45 -0700 From: Andrew Morton To: akpm@linux-foundation.org, david@redhat.com, imbrenda@linux.ibm.com, jack@suse.cz, jhubbard@nvidia.com, kirill.shutemov@linux.intel.com, linmiaohe@huawei.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, torvalds@linux-foundation.org Subject: [patch 072/212] mm: gup: use helper PAGE_ALIGNED in populate_vma_page_range() Message-ID: <20210902215345.YsVmhY1GZ%akpm@linux-foundation.org> In-Reply-To: <20210902144820.78957dff93d7bea620d55a89@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=euKJXObn; dmarc=none; spf=pass (imf28.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: B5114900009A X-Stat-Signature: yjgu4q43hsge93tbzub3bh7uz471qb96 X-HE-Tag: 1630619626-954747 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Miaohe Lin Subject: mm: gup: use helper PAGE_ALIGNED in populate_vma_page_range() Use helper PAGE_ALIGNED to check if address is aligned to PAGE_SIZE. Minor readability improvement. Link: https://lkml.kernel.org/r/20210807093620.21347-6-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: John Hubbard Reviewed-by: David Hildenbrand Reviewed-by: Claudio Imbrenda Cc: Jan Kara Cc: Kirill A. Shutemov Signed-off-by: Andrew Morton --- mm/gup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/mm/gup.c~mm-gup-use-helper-page_aligned-in-populate_vma_page_range +++ a/mm/gup.c @@ -1471,8 +1471,8 @@ long populate_vma_page_range(struct vm_a unsigned long nr_pages = (end - start) / PAGE_SIZE; int gup_flags; - VM_BUG_ON(start & ~PAGE_MASK); - VM_BUG_ON(end & ~PAGE_MASK); + VM_BUG_ON(!PAGE_ALIGNED(start)); + VM_BUG_ON(!PAGE_ALIGNED(end)); VM_BUG_ON_VMA(start < vma->vm_start, vma); VM_BUG_ON_VMA(end > vma->vm_end, vma); mmap_assert_locked(mm);