Skip to content

Commit 40ba2cd

Browse files
weiyang-linuxgregkh
authored andcommitted
drivers/base/memory: init_memory_block() first parameter is not necessary
The first parameter of init_memory_block() is intended to retrieve the memory_block initiated. But now, we never use it. Drop it for now. 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 105fbc2 commit 40ba2cd

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

drivers/base/memory.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -570,8 +570,7 @@ int register_memory(struct memory_block *memory)
570570
return ret;
571571
}
572572

573-
static int init_memory_block(struct memory_block **memory,
574-
unsigned long block_id, unsigned long state)
573+
static int init_memory_block(unsigned long block_id, unsigned long state)
575574
{
576575
struct memory_block *mem;
577576
unsigned long start_pfn;
@@ -594,14 +593,12 @@ static int init_memory_block(struct memory_block **memory,
594593

595594
ret = register_memory(mem);
596595

597-
*memory = mem;
598596
return ret;
599597
}
600598

601599
static int add_memory_block(unsigned long base_section_nr)
602600
{
603601
int section_count = 0;
604-
struct memory_block *mem;
605602
unsigned long nr;
606603

607604
for (nr = base_section_nr; nr < base_section_nr + sections_per_block;
@@ -611,7 +608,7 @@ static int add_memory_block(unsigned long base_section_nr)
611608

612609
if (section_count == 0)
613610
return 0;
614-
return init_memory_block(&mem, base_memory_block_id(base_section_nr),
611+
return init_memory_block(base_memory_block_id(base_section_nr),
615612
MEM_ONLINE);
616613
}
617614

@@ -647,7 +644,7 @@ int create_memory_block_devices(unsigned long start, unsigned long size)
647644
return -EINVAL;
648645

649646
for (block_id = start_block_id; block_id != end_block_id; block_id++) {
650-
ret = init_memory_block(&mem, block_id, MEM_OFFLINE);
647+
ret = init_memory_block(block_id, MEM_OFFLINE);
651648
if (ret)
652649
break;
653650
}

0 commit comments

Comments
 (0)