Skip to content

Commit 9dc5128

Browse files
deecempe
authored andcommitted
powerpc: Fix unused function warning 'lmb_to_memblock'
This patch fixes the following warning: arch/powerpc/platforms/pseries/hotplug-memory.c:323:29: error: 'lmb_to_memblock' defined but not used [-Werror=unused-function] static struct memory_block *lmb_to_memblock(struct of_drconf_cell *lmb) ^~~~~~~~~~~~~~~ The only consumer of this function is 'dlpar_remove_lmb', which is enabled with CONFIG_MEMORY_HOTREMOVE, so move it into the same ifdef block. Signed-off-by: Michael Ellerman <[email protected]>
1 parent bc14c49 commit 9dc5128

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

arch/powerpc/platforms/pseries/hotplug-memory.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -320,19 +320,6 @@ static int dlpar_remove_device_tree_lmb(struct of_drconf_cell *lmb)
320320
return dlpar_update_device_tree_lmb(lmb);
321321
}
322322

323-
static struct memory_block *lmb_to_memblock(struct of_drconf_cell *lmb)
324-
{
325-
unsigned long section_nr;
326-
struct mem_section *mem_sect;
327-
struct memory_block *mem_block;
328-
329-
section_nr = pfn_to_section_nr(PFN_DOWN(lmb->base_addr));
330-
mem_sect = __nr_to_section(section_nr);
331-
332-
mem_block = find_memory_block(mem_sect);
333-
return mem_block;
334-
}
335-
336323
#ifdef CONFIG_MEMORY_HOTREMOVE
337324
static int pseries_remove_memblock(unsigned long base, unsigned int memblock_size)
338325
{
@@ -420,6 +407,19 @@ static bool lmb_is_removable(struct of_drconf_cell *lmb)
420407

421408
static int dlpar_add_lmb(struct of_drconf_cell *);
422409

410+
static struct memory_block *lmb_to_memblock(struct of_drconf_cell *lmb)
411+
{
412+
unsigned long section_nr;
413+
struct mem_section *mem_sect;
414+
struct memory_block *mem_block;
415+
416+
section_nr = pfn_to_section_nr(PFN_DOWN(lmb->base_addr));
417+
mem_sect = __nr_to_section(section_nr);
418+
419+
mem_block = find_memory_block(mem_sect);
420+
return mem_block;
421+
}
422+
423423
static int dlpar_remove_lmb(struct of_drconf_cell *lmb)
424424
{
425425
struct memory_block *mem_block;

0 commit comments

Comments
 (0)