From patchwork Tue Jul 3 05:55:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yasuaki Ishimatsu X-Patchwork-Id: 168706 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 45C0A2C0114 for ; Tue, 3 Jul 2012 15:56:11 +1000 (EST) Received: from fgwmail5.fujitsu.co.jp (fgwmail5.fujitsu.co.jp [192.51.44.35]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3568E2C00AD for ; Tue, 3 Jul 2012 15:55:41 +1000 (EST) Received: from m3.gw.fujitsu.co.jp (unknown [10.0.50.73]) by fgwmail5.fujitsu.co.jp (Postfix) with ESMTP id 7CE0E3EE0C3 for ; Tue, 3 Jul 2012 14:55:39 +0900 (JST) Received: from smail (m3 [127.0.0.1]) by outgoing.m3.gw.fujitsu.co.jp (Postfix) with ESMTP id 5C79745DEB9 for ; Tue, 3 Jul 2012 14:55:39 +0900 (JST) Received: from s3.gw.fujitsu.co.jp (s3.gw.fujitsu.co.jp [10.0.50.93]) by m3.gw.fujitsu.co.jp (Postfix) with ESMTP id 412D345DEAD for ; Tue, 3 Jul 2012 14:55:39 +0900 (JST) Received: from s3.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s3.gw.fujitsu.co.jp (Postfix) with ESMTP id 240271DB8047 for ; Tue, 3 Jul 2012 14:55:39 +0900 (JST) Received: from g01jpexchyt10.g01.fujitsu.local (g01jpexchyt10.g01.fujitsu.local [10.128.194.49]) by s3.gw.fujitsu.co.jp (Postfix) with ESMTP id C9AEC1DB8044 for ; Tue, 3 Jul 2012 14:55:38 +0900 (JST) Received: from [127.0.0.1] (10.124.101.33) by g01jpexchyt10.g01.fujitsu.local (10.128.194.49) with Microsoft SMTP Server id 14.2.309.2; Tue, 3 Jul 2012 14:55:35 +0900 X-SecurityPolicyCheck: OK by SHieldMailChecker v1.7.4 Message-ID: <4FF2894A.7020303@jp.fujitsu.com> Date: Tue, 3 Jul 2012 14:55:22 +0900 From: Yasuaki Ishimatsu User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: , , , Subject: [RFC PATCH v2 3/13] unify argument of firmware_map_add_early/hotplug References: <4FF287C3.4030901@jp.fujitsu.com> In-Reply-To: <4FF287C3.4030901@jp.fujitsu.com> Cc: len.brown@intel.com, paulus@samba.org, minchan.kim@gmail.com, kosaki.motohiro@jp.fujitsu.com, rientjes@google.com, cl@linux.com, akpm@linux-foundation.org, liuj97@gmail.com X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" There are two ways to create /sys/firmware/memmap/X sysfs: - firmware_map_add_early When the system starts, it is calledd from e820_reserve_resources() - firmware_map_add_hotplug When the memory is hot plugged, it is called from add_memory() But these functions are called without unifying value of end argument as below: - end argument of firmware_map_add_early() : start + size - 1 - end argument of firmware_map_add_hogplug() : start + size The patch unifies them to "start + size - 1". CC: David Rientjes CC: Jiang Liu CC: Len Brown CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Christoph Lameter Cc: Minchan Kim CC: Andrew Morton CC: KOSAKI Motohiro Signed-off-by: Yasuaki Ishimatsu --- mm/memory_hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-3.5-rc4/mm/memory_hotplug.c =================================================================== --- linux-3.5-rc4.orig/mm/memory_hotplug.c 2012-07-03 14:21:58.332264022 +0900 +++ linux-3.5-rc4/mm/memory_hotplug.c 2012-07-03 14:22:00.190240794 +0900 @@ -642,7 +642,7 @@ int __ref add_memory(int nid, u64 start, } /* create new memmap entry */ - firmware_map_add_hotplug(start, start + size, "System RAM"); + firmware_map_add_hotplug(start, start + size - 1, "System RAM"); goto out;