From patchwork Tue Mar 22 21:45:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12789221 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9C66C433EF for ; Tue, 22 Mar 2022 21:45:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EFCC76B0134; Tue, 22 Mar 2022 17:45:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E364B6B0135; Tue, 22 Mar 2022 17:45:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CFD4E6B0136; Tue, 22 Mar 2022 17:45:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id BE8A36B0134 for ; Tue, 22 Mar 2022 17:45:31 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 921EA16E6 for ; Tue, 22 Mar 2022 21:45:31 +0000 (UTC) X-FDA: 79273354062.03.AE4F95B Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf29.hostedemail.com (Postfix) with ESMTP id 1A411120022 for ; Tue, 22 Mar 2022 21:45:30 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 873526119A; Tue, 22 Mar 2022 21:45:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC679C340EC; Tue, 22 Mar 2022 21:45:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1647985530; bh=4St+tgtH1Jiny/9gcE5NZiAuSuxhgUqN6h/sMNCrcOo=; h=Date:To:From:In-Reply-To:Subject:From; b=S1uAoqi///NFwCX24MtkGNPepHOZfwW155zP4chrh2hVdkY79uJtB1qbqmlgPDDe/ d0Rx+TLhOzr/fyOYkooGv0iUnvRciVPcpK2PWshewPCpaciNPI3ZRJ6eXIEQdi1+00 Dpa0wpWzmZjRNqAoSery7cvJ8qtZtXdlvyi4mbag= Date: Tue, 22 Mar 2022 14:45:29 -0700 To: anshuman.khandual@arm.com,linmiaohe@huawei.com,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220322143803.04a5e59a07e48284f196a2f9@linux-foundation.org> Subject: [patch 137/227] mm: remove unneeded local variable follflags Message-Id: <20220322214529.DC679C340EC@smtp.kernel.org> X-Stat-Signature: g9km1bsbjxywf1ht4wk7jzuwjr5uwgc8 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 1A411120022 Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b="S1uAoqi/"; dmarc=none; spf=pass (imf29.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspam-User: X-HE-Tag: 1647985530-406589 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: remove unneeded local variable follflags We can pass FOLL_GET | FOLL_DUMP to follow_page directly to simplify the code a bit in add_page_for_migration and split_huge_pages_pid. Link: https://lkml.kernel.org/r/20220311072002.35575-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Anshuman Khandual Signed-off-by: Andrew Morton --- mm/huge_memory.c | 4 +--- mm/migrate.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) --- a/mm/huge_memory.c~mm-remove-unneeded-local-variable-follflags-v2 +++ a/mm/huge_memory.c @@ -2953,7 +2953,6 @@ static int split_huge_pages_pid(int pid, */ for (addr = vaddr_start; addr < vaddr_end; addr += PAGE_SIZE) { struct vm_area_struct *vma = find_vma(mm, addr); - unsigned int follflags; struct page *page; if (!vma || addr < vma->vm_start) @@ -2966,8 +2965,7 @@ static int split_huge_pages_pid(int pid, } /* FOLL_DUMP to ignore special (like zero) pages */ - follflags = FOLL_GET | FOLL_DUMP; - page = follow_page(vma, addr, follflags); + page = follow_page(vma, addr, FOLL_GET | FOLL_DUMP); if (IS_ERR(page)) continue; --- a/mm/migrate.c~mm-remove-unneeded-local-variable-follflags-v2 +++ a/mm/migrate.c @@ -1611,7 +1611,6 @@ static int add_page_for_migration(struct { struct vm_area_struct *vma; struct page *page; - unsigned int follflags; int err; mmap_read_lock(mm); @@ -1621,8 +1620,7 @@ static int add_page_for_migration(struct goto out; /* FOLL_DUMP to ignore special (like zero) pages */ - follflags = FOLL_GET | FOLL_DUMP; - page = follow_page(vma, addr, follflags); + page = follow_page(vma, addr, FOLL_GET | FOLL_DUMP); err = PTR_ERR(page); if (IS_ERR(page))