Skip to content

Commit 178bdbe

Browse files
weiyang-linuxgregkh
authored andcommitted
drivers/base/memory: rename base_memory_block_id to memory_block_id
memory_block may have a larger granularity than section, this is why we have base_section_nr. But base_memory_block_id seems a little misleading, since there is no larger granularity concept which groups several memory_block. What we need here is the exact memory_block_id to a section_nr. Let's rename it to make it more precise. Signed-off-by: Wei Yang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 40ba2cd commit 178bdbe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/base/memory.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ int memhp_online_type_from_str(const char *str)
5050

5151
static int sections_per_block;
5252

53-
static inline unsigned long base_memory_block_id(unsigned long section_nr)
53+
static inline unsigned long memory_block_id(unsigned long section_nr)
5454
{
5555
return section_nr / sections_per_block;
5656
}
5757

5858
static inline unsigned long pfn_to_block_id(unsigned long pfn)
5959
{
60-
return base_memory_block_id(pfn_to_section_nr(pfn));
60+
return memory_block_id(pfn_to_section_nr(pfn));
6161
}
6262

6363
static inline unsigned long phys_to_block_id(unsigned long phys)
@@ -517,7 +517,7 @@ static struct memory_block *find_memory_block_by_id(unsigned long block_id)
517517
*/
518518
struct memory_block *find_memory_block(struct mem_section *section)
519519
{
520-
unsigned long block_id = base_memory_block_id(__section_nr(section));
520+
unsigned long block_id = memory_block_id(__section_nr(section));
521521

522522
return find_memory_block_by_id(block_id);
523523
}
@@ -608,7 +608,7 @@ static int add_memory_block(unsigned long base_section_nr)
608608

609609
if (section_count == 0)
610610
return 0;
611-
return init_memory_block(base_memory_block_id(base_section_nr),
611+
return init_memory_block(memory_block_id(base_section_nr),
612612
MEM_ONLINE);
613613
}
614614

0 commit comments

Comments
 (0)