Skip to content

Commit

Permalink
mm/memblock.c: remove unnecessary memblock_type variable
Browse files Browse the repository at this point in the history
We define struct memblock_type *type in the memblock_add_region() and
memblock_reserve_region() functions only for passing it to the
memlock_add_range() and memblock_reserve_range() functions.  Let's
remove these variables and will pass a type directly.

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
0xAX authored and torvalds committed Mar 15, 2016
1 parent a75e1f6 commit 5aa1748
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions mm/memblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,14 +612,12 @@ static int __init_memblock memblock_add_region(phys_addr_t base,
int nid,
unsigned long flags)
{
struct memblock_type *type = &memblock.memory;

memblock_dbg("memblock_add: [%#016llx-%#016llx] flags %#02lx %pF\n",
(unsigned long long)base,
(unsigned long long)base + size - 1,
flags, (void *)_RET_IP_);

return memblock_add_range(type, base, size, nid, flags);
return memblock_add_range(&memblock.memory, base, size, nid, flags);
}

int __init_memblock memblock_add(phys_addr_t base, phys_addr_t size)
Expand Down Expand Up @@ -740,14 +738,12 @@ static int __init_memblock memblock_reserve_region(phys_addr_t base,
int nid,
unsigned long flags)
{
struct memblock_type *type = &memblock.reserved;

memblock_dbg("memblock_reserve: [%#016llx-%#016llx] flags %#02lx %pF\n",
(unsigned long long)base,
(unsigned long long)base + size - 1,
flags, (void *)_RET_IP_);

return memblock_add_range(type, base, size, nid, flags);
return memblock_add_range(&memblock.reserved, base, size, nid, flags);
}

int __init_memblock memblock_reserve(phys_addr_t base, phys_addr_t size)
Expand Down

0 comments on commit 5aa1748

Please sign in to comment.