All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@linux.vnet.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Richard Kuo <rkuo@codeaurora.org>,
	Ley Foon Tan <lftan@altera.com>,
	Richard Weinberger <richard@nod.at>, Guan Xuetao <gxt@pku.edu.cn>,
	Michal Hocko <mhocko@kernel.org>,
	linux-hexagon@vger.kernel.org, nios2-dev@lists.rocketboards.org,
	linux-um@lists.infradead.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org,
	Mike Rapoport <rppt@linux.vnet.ibm.com>
Subject: [PATCH 5/7] um: setup_physmem: stop using global variables
Date: Fri,  3 Aug 2018 22:58:48 +0300	[thread overview]
Message-ID: <1533326330-31677-6-git-send-email-rppt@linux.vnet.ibm.com> (raw)
In-Reply-To: <1533326330-31677-1-git-send-email-rppt@linux.vnet.ibm.com>

The setup_physmem() function receives uml_physmem and uml_reserved as
parameters and still used these global variables. Replace such usage with
local variables.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Acked-by: Richard Weinberger <richard@nod.at>
---
 arch/um/kernel/physmem.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c
index f02596e..0eaec0e 100644
--- a/arch/um/kernel/physmem.c
+++ b/arch/um/kernel/physmem.c
@@ -86,7 +86,7 @@ void __init setup_physmem(unsigned long start, unsigned long reserve_end,
 	long map_size;
 	int err;
 
-	offset = uml_reserved - uml_physmem;
+	offset = reserve_end - start;
 	map_size = len - offset;
 	if(map_size <= 0) {
 		os_warn("Too few physical memory! Needed=%lu, given=%lu\n",
@@ -96,12 +96,12 @@ void __init setup_physmem(unsigned long start, unsigned long reserve_end,
 
 	physmem_fd = create_mem_file(len + highmem);
 
-	err = os_map_memory((void *) uml_reserved, physmem_fd, offset,
+	err = os_map_memory((void *) reserve_end, physmem_fd, offset,
 			    map_size, 1, 1, 1);
 	if (err < 0) {
 		os_warn("setup_physmem - mapping %ld bytes of memory at 0x%p "
 			"failed - errno = %d\n", map_size,
-			(void *) uml_reserved, err);
+			(void *) reserve_end, err);
 		exit(1);
 	}
 
-- 
2.7.4


WARNING: multiple messages have this Message-ID (diff)
From: Mike Rapoport <rppt@linux.vnet.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>,
	linux-hexagon@vger.kernel.org, linux-um@lists.infradead.org,
	linux-kernel@vger.kernel.org, Michal Hocko <mhocko@kernel.org>,
	linux-mm@kvack.org, nios2-dev@lists.rocketboards.org,
	Richard Weinberger <richard@nod.at>,
	Ley Foon Tan <lftan@altera.com>,
	Richard Kuo <rkuo@codeaurora.org>, Guan Xuetao <gxt@pku.edu.cn>
Subject: [PATCH 5/7] um: setup_physmem: stop using global variables
Date: Fri,  3 Aug 2018 22:58:48 +0300	[thread overview]
Message-ID: <1533326330-31677-6-git-send-email-rppt@linux.vnet.ibm.com> (raw)
In-Reply-To: <1533326330-31677-1-git-send-email-rppt@linux.vnet.ibm.com>

The setup_physmem() function receives uml_physmem and uml_reserved as
parameters and still used these global variables. Replace such usage with
local variables.

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Acked-by: Richard Weinberger <richard@nod.at>
---
 arch/um/kernel/physmem.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c
index f02596e..0eaec0e 100644
--- a/arch/um/kernel/physmem.c
+++ b/arch/um/kernel/physmem.c
@@ -86,7 +86,7 @@ void __init setup_physmem(unsigned long start, unsigned long reserve_end,
 	long map_size;
 	int err;
 
-	offset = uml_reserved - uml_physmem;
+	offset = reserve_end - start;
 	map_size = len - offset;
 	if(map_size <= 0) {
 		os_warn("Too few physical memory! Needed=%lu, given=%lu\n",
@@ -96,12 +96,12 @@ void __init setup_physmem(unsigned long start, unsigned long reserve_end,
 
 	physmem_fd = create_mem_file(len + highmem);
 
-	err = os_map_memory((void *) uml_reserved, physmem_fd, offset,
+	err = os_map_memory((void *) reserve_end, physmem_fd, offset,
 			    map_size, 1, 1, 1);
 	if (err < 0) {
 		os_warn("setup_physmem - mapping %ld bytes of memory at 0x%p "
 			"failed - errno = %d\n", map_size,
-			(void *) uml_reserved, err);
+			(void *) reserve_end, err);
 		exit(1);
 	}
 
-- 
2.7.4


_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um


  parent reply	other threads:[~2018-08-03 19:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-03 19:58 [PATCH RESEND 0/7] switch several architectures NO_BOOTMEM Mike Rapoport
2018-08-03 19:58 ` Mike Rapoport
2018-08-03 19:58 ` [PATCH 1/7] hexagon: switch to NO_BOOTMEM Mike Rapoport
2018-08-03 19:58   ` Mike Rapoport
2018-08-03 19:58 ` [PATCH 2/7] of: ignore sub-page memory regions Mike Rapoport
2018-08-03 19:58   ` Mike Rapoport
2018-08-03 19:58 ` [PATCH 3/7] nios2: use generic early_init_dt_add_memory_arch Mike Rapoport
2018-08-03 19:58   ` Mike Rapoport
2018-08-03 19:58 ` [PATCH 4/7] nios2: switch to NO_BOOTMEM Mike Rapoport
2018-08-03 19:58   ` Mike Rapoport
2018-08-03 19:58 ` Mike Rapoport [this message]
2018-08-03 19:58   ` [PATCH 5/7] um: setup_physmem: stop using global variables Mike Rapoport
2018-08-03 19:58 ` [PATCH 6/7] um: switch to NO_BOOTMEM Mike Rapoport
2018-08-03 19:58   ` Mike Rapoport
2018-08-03 19:58 ` [PATCH 7/7] unicore32: " Mike Rapoport
2018-08-03 19:58   ` Mike Rapoport
2018-08-29  7:20 ` [PATCH RESEND 0/7] switch several architectures NO_BOOTMEM Mike Rapoport

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1533326330-31677-6-git-send-email-rppt@linux.vnet.ibm.com \
    --to=rppt@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=gxt@pku.edu.cn \
    --cc=lftan@altera.com \
    --cc=linux-hexagon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-um@lists.infradead.org \
    --cc=mhocko@kernel.org \
    --cc=nios2-dev@lists.rocketboards.org \
    --cc=richard@nod.at \
    --cc=rkuo@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.