Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3300814imj; Mon, 11 Feb 2019 18:13:47 -0800 (PST) X-Google-Smtp-Source: AHgI3IbjXNinMt9wxg5lxiuupMyag3rN7MTQ4MwHpDvhe2duiqLkyyuoZ+oCrmly5POmcb+CtCgd X-Received: by 2002:a17:902:129:: with SMTP id 38mr1532851plb.140.1549937627410; Mon, 11 Feb 2019 18:13:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549937627; cv=none; d=google.com; s=arc-20160816; b=wNaVYOxk1UEA+yQIyqykr3ehqIfvxiBluVE1uGPRWclCqWTAd0jFtotcjp5d6mApul 43izjjqF9HhX7NhR6Xxr9SMqQl4ll1hlV0StZMxcCU51xALbPhOBaqXkwtDTXD53EdU0 Lke7DeuuA+TBg8omyV3VpY0k91zW9UXvGwstX1mvEPY9b0kQ0shugQfM6WxkuxW0Ix7q prF+Atg1QNER8taQ/+xV07uMehfjfxpjEyAXwqmpS2OxygdPC+5TEb3tAOk5RpvhMJnf 674CHVVV3J4ZWHIw5UKjnXvYju8AVsWEru5txS5V2yB8xg7o/JNQX3hZPrlSqnmgdCaD AuHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ujq4HV51DT1daZ5y+FJAaBqAC4ZuDb4RMUoL9lpv32o=; b=e+ASX/anhYpYKaGkCJlt8h8GNgcLBt4o+Ee40LpV8YsLXsLs2BzOF8PbO2IM1Bk6d3 iWwaoeRtZ/Tr19CpSpAzDsOI7lplnh04NLkKbPKL8w40MKqmv+de32tQPBrOh0GlGwEI GFoq08iEgv/SK8uE4AjenbpYaYhX+RMHPcbEzwjO/ifKDoEhptYKcSgx2KiVdR+SM+zP KIp/K/7TPnuUZyxr2wEcP/1PDYTAg+UgEyeWd/FS0YfwVj0kPQPrYKkPMO7Oz9ziNVqL 4qHlSV1+x2gNYai3ZffaTjhswIQU8k6s/Xc1ptc1gyXbMlMDVvbklxd14crdC8QggpB1 KKKw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l7si423409plb.366.2019.02.11.18.13.31; Mon, 11 Feb 2019 18:13:47 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728055AbfBLCNF (ORCPT + 99 others); Mon, 11 Feb 2019 21:13:05 -0500 Received: from mga09.intel.com ([134.134.136.24]:26869 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726751AbfBLCMx (ORCPT ); Mon, 11 Feb 2019 21:12:53 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Feb 2019 18:12:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,361,1544515200"; d="scan'208";a="146057852" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by fmsmga001.fm.intel.com with ESMTP; 11 Feb 2019 18:12:52 -0800 From: Wei Yang To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.or, tglx@linutronix.de, Wei Yang Subject: [PATCH 2/6] x86, mm: remove check in save_mr Date: Tue, 12 Feb 2019 10:12:11 +0800 Message-Id: <20190212021215.13247-3-richardw.yang@linux.intel.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190212021215.13247-1-richardw.yang@linux.intel.com> References: <20190212021215.13247-1-richardw.yang@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This check has been validated before calling save_mr. It is not necessary to do this again. Signed-off-by: Wei Yang --- arch/x86/mm/init.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index 1b980b70911a..6fb84be79c7c 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c @@ -259,14 +259,12 @@ static int __meminit save_mr(struct map_range *mr, int nr_range, unsigned long start_pfn, unsigned long end_pfn, unsigned long page_size_mask) { - if (start_pfn < end_pfn) { - if (nr_range >= NR_RANGE_MR) - panic("run out of range for init_memory_mapping\n"); - mr[nr_range].start = start_pfn<= NR_RANGE_MR) + panic("run out of range for init_memory_mapping\n"); + mr[nr_range].start = start_pfn<