Skip to content

Commit fe14512

Browse files
rppttorvalds
authored andcommitted
memblock: remove memblock_{set,clear}_region_flags
The memblock API provides dedicated helpers to set or clear a flag on a memory region, e.g. memblock_{mark,clear}_hotplug(). The memblock_{set,clear}_region_flags() functions are used only by the memblock internal function that adjusts the region flags. Drop these functions and use open-coded implementation instead. Link: http://lkml.kernel.org/r/1549455025-17706-2-git-send-email-rppt@linux.ibm.com Signed-off-by: Mike Rapoport <rppt@linux.ibm.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Cc: Michal Hocko <mhocko@suse.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 26fb3da commit fe14512

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

include/linux/memblock.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -273,18 +273,6 @@ void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn,
273273
for_each_mem_range_rev(i, &memblock.memory, &memblock.reserved, \
274274
nid, flags, p_start, p_end, p_nid)
275275

276-
static inline void memblock_set_region_flags(struct memblock_region *r,
277-
enum memblock_flags flags)
278-
{
279-
r->flags |= flags;
280-
}
281-
282-
static inline void memblock_clear_region_flags(struct memblock_region *r,
283-
enum memblock_flags flags)
284-
{
285-
r->flags &= ~flags;
286-
}
287-
288276
#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
289277
int memblock_set_node(phys_addr_t base, phys_addr_t size,
290278
struct memblock_type *type, int nid);

mm/memblock.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -858,11 +858,14 @@ static int __init_memblock memblock_setclr_flag(phys_addr_t base,
858858
if (ret)
859859
return ret;
860860

861-
for (i = start_rgn; i < end_rgn; i++)
861+
for (i = start_rgn; i < end_rgn; i++) {
862+
struct memblock_region *r = &type->regions[i];
863+
862864
if (set)
863-
memblock_set_region_flags(&type->regions[i], flag);
865+
r->flags |= flag;
864866
else
865-
memblock_clear_region_flags(&type->regions[i], flag);
867+
r->flags &= ~flag;
868+
}
866869

867870
memblock_merge_regions(type);
868871
return 0;

0 commit comments

Comments
 (0)