Received: by 10.213.65.68 with SMTP id h4csp433929imn; Tue, 13 Mar 2018 08:56:38 -0700 (PDT) X-Google-Smtp-Source: AG47ELsMW2jYHSe6UY3wi/mmAYyAtny+mfcbVhLpxNSyNZ0V3zBaa2lqWGomR1cFNEaNyL6Tdiwm X-Received: by 10.99.42.72 with SMTP id q69mr898068pgq.168.1520956598821; Tue, 13 Mar 2018 08:56:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520956598; cv=none; d=google.com; s=arc-20160816; b=ATwI8XBUgic47puuWib8ciHhUS3KUZLI6KZzVVAG2URUpAQLBwVawYFf47eiiO2WxR 01p2L8DKvgJM+lGMvdDw4hQjcqgrFBdPQ3aCEa0DYv2uoEp59YfWtLmSF3zReKVhMTSF BkOsG96Duw2IDzHZ54WsNMcVSxw3RvKk290lVy/OHk+XF5a++Eu1sbhwU0ytXU4yMmuc IenuMIOqcNslPeKkGsdMQ4/zHSpG5TW+6rnIQ2f5ixWhBXyNfBRW/jhV6+HpzaC3FVp3 Y51S4eRC1kVLbaSHh3Tlx9z5o36EzvzPbUOrn40fHb+CV8Tackkv0xeSJVLPyHknNqOh OgHw== 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=5ir55J50kGHFWuh9PN+Us7otKxoAcDjLwQinzYSxlnY=; b=T1wtzc3MlfkMBTBD33ZfFaF4HucahpOATS02+CxQrSt/psEj2dRKPJbKErgXxWMUQD 6E6M31Zd+xQu/6RjhHSANYCXamJEx9k+69IGJTD4vI5kgAjct+PRsRmQIB9BrzJHfKv9 FIw6+NocLfmei7+uSpiueOSuDpEUdTHh/ZDcX06yhAu4K8UYl6UAnfm+ICZ80AzyJRE9 pmQZFXfsZ4LNuwv02U79WKNPtTojKJfsWKxaYJ7yYgzXh4jZNpJSByS9NHLAbU4D3xfW L1Qi+4cDQ4iYbAC2IzybWYbVskB3vbZlwgk6KN6dFBJAuzVvHGXDibGBKIFBeGVrj0O/ m12Q== 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 z15si281901pge.522.2018.03.13.08.56.24; Tue, 13 Mar 2018 08:56:38 -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 S933069AbeCMPzA (ORCPT + 99 others); Tue, 13 Mar 2018 11:55:00 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35118 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934632AbeCMPi6 (ORCPT ); Tue, 13 Mar 2018 11:38:58 -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 B35E1F61; Tue, 13 Mar 2018 15:38:57 +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.14 084/140] mm/memblock.c: hardcode the end_pfn being -1 Date: Tue, 13 Mar 2018 16:24:47 +0100 Message-Id: <20180313152503.820272972@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180313152458.201155692@linuxfoundation.org> References: <20180313152458.201155692@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.14-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); } /**