Received: by 10.213.65.68 with SMTP id h4csp465121imn; Tue, 13 Mar 2018 09:55:05 -0700 (PDT) X-Google-Smtp-Source: AG47ELvlcvH4OAtnRGNKy+R+A3T50nFBf2WeESyF7EMMx7IGjMjnjc0r/aWFu4X2MyvNqR3cDVvl X-Received: by 2002:a17:902:4d46:: with SMTP id o6-v6mr1174489plh.166.1520960105082; Tue, 13 Mar 2018 09:55:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520960105; cv=none; d=google.com; s=arc-20160816; b=bDG7qbLiuc7xwkdLPudgPlv67svP8bjEOjFQKIKxWQ7p3rqXZZ54e7Hknr8YzcoA4t 5rHoWA7IQs5fRw1OIkV4uUma4+X3bl3a3qWzoJBYJC87av0Ap4dkecxisNZZv0OY0dg5 DJHV9CCT34r2FRWoywBkRICqgFTmzxaOBxTPm9lAiYhEO9xSV6GwH3j8B78L03oegkWX HqZyiHFT+9QZd7dLA19YnD6KIZfLFUQdX3B4uuHSO/UUAx3HIuo4R7U88sTWe/oldk3J R4KJTy/ADALIIMtfWUF4T3TVuYklc//Mw6GhbUmcNefyqCVSfHZvfawPUlE6gLcF+ANT 2zDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=LxTEVpO5m9yjoZSHR+Xj2lX8FRSRezcdW1Qeb7fMYU4=; b=ujheXRJf7auVT6kwFgmS6c6YeGWe98uteM0p6IFY92co81EzidN3s+pzGmPFsr6MWf qwGeBfSlXM4ks0T3g3a3LAhzL/xJpfCTqJMQmMLH5macWj6U73VdjSQdGTTQHr5dysof qoBj24lBg9cJ8GDqth1Keouku0OhNxw7LveR5MC38dtirKvJQ0OxVzaE2zynrc8pjHa6 0OBAhjNQA73m1lOBRG1v7qJKu5N+lU7y2tzC3WfWjJlUT8bauH2zoZrWls0ilvoUtUvS 9zPZRIfV2xyWQ+3Qna2rI9lyhPd+TDmmK1RWLonUQNY5uTgA7gSxKLAaK/+1xh+SmzQp o5ww== 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 y22si288060pfm.357.2018.03.13.09.54.50; Tue, 13 Mar 2018 09:55:05 -0700 (PDT) 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 S1752715AbeCMPay (ORCPT + 99 others); Tue, 13 Mar 2018 11:30:54 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58950 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751572AbeCMPav (ORCPT ); Tue, 13 Mar 2018 11:30:51 -0400 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 7F74911B3; Tue, 13 Mar 2018 15:30:50 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Vacek , Michal Hocko , Vlastimil Babka , Mel Gorman , Pavel Tatashin , Paul Burton , Andrew Morton , Linus Torvalds Subject: [PATCH 4.15 048/146] mm/memblock.c: hardcode the end_pfn being -1 Date: Tue, 13 Mar 2018 16:23:35 +0100 Message-Id: <20180313152324.348371381@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180313152320.439085687@linuxfoundation.org> References: <20180313152320.439085687@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Daniel Vacek commit 379b03b7fa05f7db521b7732a52692448a3c34fe upstream. This is just a cleanup. It aids handling the special end case in the next commit. [akpm@linux-foundation.org: make it work against current -linus, not against -mm] [akpm@linux-foundation.org: make it work against current -linus, not against -mm some more] Link: http://lkml.kernel.org/r/1ca478d4269125a99bcfb1ca04d7b88ac1aee924.1520011944.git.neelx@redhat.com Signed-off-by: Daniel Vacek Cc: Michal Hocko Cc: Vlastimil Babka Cc: Mel Gorman Cc: Pavel Tatashin Cc: Paul Burton Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- mm/memblock.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/mm/memblock.c +++ b/mm/memblock.c @@ -1107,7 +1107,7 @@ unsigned long __init_memblock memblock_n struct memblock_type *type = &memblock.memory; unsigned int right = type->cnt; unsigned int mid, left = 0; - phys_addr_t addr = PFN_PHYS(pfn + 1); + phys_addr_t addr = PFN_PHYS(++pfn); do { mid = (right + left) / 2; @@ -1118,15 +1118,15 @@ unsigned long __init_memblock memblock_n type->regions[mid].size)) left = mid + 1; else { - /* addr is within the region, so pfn + 1 is valid */ - return min(pfn + 1, max_pfn); + /* addr is within the region, so pfn is valid */ + return pfn; } } while (left < right); if (right == type->cnt) - return max_pfn; + return -1UL; else - return min(PHYS_PFN(type->regions[right].base), max_pfn); + return PHYS_PFN(type->regions[right].base); } /**