um: setup_physmem: stop using global variables
authorMike Rapoport <rppt@linux.vnet.ibm.com>
Fri, 26 Oct 2018 22:04:58 +0000 (15:04 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 26 Oct 2018 23:25:20 +0000 (16:25 -0700)
The setup_physmem() function receives uml_physmem and uml_reserved as
parameters and still used these global variables.  Replace such usage with
local variables.

Link: http://lkml.kernel.org/r/1533326330-31677-6-git-send-email-rppt@linux.vnet.ibm.com
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Acked-by: Richard Weinberger <richard@nod.at>
Cc: Guan Xuetao <gxt@pku.edu.cn>
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
Cc: Richard Kuo <rkuo@codeaurora.org>
Cc: Rob Herring <robh@kernel.org>
Cc: Michal Hocko <mhocko@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/um/kernel/physmem.c

index f02596e9931dcadd085d8ddfbe6c6049b6ba3fe9..0eaec0e24767236c6eead47d0e85f5225c5e8bf5 100644 (file)
@@ -86,7 +86,7 @@ void __init setup_physmem(unsigned long start, unsigned long reserve_end,
        long map_size;
        int err;
 
        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",
        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);
 
 
        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,
                            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);
        }
 
                exit(1);
        }