From patchwork Mon Sep 30 19:55:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ralph Campbell X-Patchwork-Id: 11167363 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 07E8A912 for ; Mon, 30 Sep 2019 19:55:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B9DAE22501 for ; Mon, 30 Sep 2019 19:55:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="nDTe8mCy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B9DAE22501 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id CE5966B0003; Mon, 30 Sep 2019 15:55:43 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C96366B0006; Mon, 30 Sep 2019 15:55:43 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BD2566B0007; Mon, 30 Sep 2019 15:55:43 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0018.hostedemail.com [216.40.44.18]) by kanga.kvack.org (Postfix) with ESMTP id 9A8896B0003 for ; Mon, 30 Sep 2019 15:55:43 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 38A6682437C9 for ; Mon, 30 Sep 2019 19:55:43 +0000 (UTC) X-FDA: 75992642166.22.anger64_31e0a01c0e353 X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,rcampbell@nvidia.com,::linux-kernel@vger.kernel.org:kirill.shutemov@linux.intel.com:akpm@linux-foundation.org:rcampbell@nvidia.com,RULES_HIT:30012:30054:30064,0,RBL:216.228.121.65:@nvidia.com:.lbl8.mailshell.net-62.18.0.100 64.10.201.10,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: anger64_31e0a01c0e353 X-Filterd-Recvd-Size: 3597 Received: from hqemgate16.nvidia.com (hqemgate16.nvidia.com [216.228.121.65]) by imf23.hostedemail.com (Postfix) with ESMTP for ; Mon, 30 Sep 2019 19:55:42 +0000 (UTC) Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 30 Sep 2019 12:55:48 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Mon, 30 Sep 2019 12:55:40 -0700 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Mon, 30 Sep 2019 12:55:40 -0700 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 30 Sep 2019 19:55:40 +0000 Received: from hqnvemgw02.nvidia.com (172.16.227.111) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Mon, 30 Sep 2019 19:55:40 +0000 Received: from rcampbell-dev.nvidia.com (Not Verified[10.110.48.66]) by hqnvemgw02.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Mon, 30 Sep 2019 12:55:40 -0700 From: Ralph Campbell To: CC: , "Kirill A . Shutemov" , Andrew Morton , Ralph Campbell Subject: [PATCH] mm/thp: make set_huge_zero_page() return void Date: Mon, 30 Sep 2019 12:55:28 -0700 Message-ID: <20190930195528.32553-1-rcampbell@nvidia.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-NVConfidentiality: public DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1569873348; bh=5H2qPyiWDn47uqy9zIJy1yaJpC2vjsTK5L+ez/p+EZU=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: MIME-Version:X-NVConfidentiality:Content-Transfer-Encoding: Content-Type; b=nDTe8mCyf7ivJABZxIQxgN9Ejhl/rQe7zR0VTSvcPw/K+jzPlmq9K/DY0JidJl41p BmzxlD1v+LyEOqAVBSTWDVza3cyvfCDZyzBQwLdh3jx0Ln1ecmZ4n583SP3oiw9wch Rs4TyF4bS7OpLQbbADfry5Ygno6sMPsjSx6PPEI8l5HusFr0zzS52wMK2J9C0jxxvN 1PqIwWdU/rbUjTjDNEheKeiSfduVs/wg51T2z1/GckxhBz4/1OyeWMjNVnm+llMjwn lBjxCsLN4RZ/5lja7DiT8R6P9Pzu3ZJUNULM2pA+6FjM0reolqCYL89GUYfZLQYGtO 3r+tu58B8w83g== 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: The return value from set_huge_zero_page() is never checked so simplify the code by making it return void. Signed-off-by: Ralph Campbell --- mm/huge_memory.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index c5cb6dcd6c69..6cf0ee65538d 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -686,20 +686,18 @@ static inline gfp_t alloc_hugepage_direct_gfpmask(struct vm_area_struct *vma) } /* Caller must hold page table lock. */ -static bool set_huge_zero_page(pgtable_t pgtable, struct mm_struct *mm, +static void set_huge_zero_page(pgtable_t pgtable, struct mm_struct *mm, struct vm_area_struct *vma, unsigned long haddr, pmd_t *pmd, struct page *zero_page) { pmd_t entry; - if (!pmd_none(*pmd)) - return false; + entry = mk_pmd(zero_page, vma->vm_page_prot); entry = pmd_mkhuge(entry); if (pgtable) pgtable_trans_huge_deposit(mm, pmd, pgtable); set_pmd_at(mm, haddr, pmd, entry); mm_inc_nr_ptes(mm); - return true; } vm_fault_t do_huge_pmd_anonymous_page(struct vm_fault *vmf)