* [PATCH] powerpc: Fix unused function warning 'lmb_to_memblock'
@ 2016-08-01 6:32 alastair
2016-08-09 11:26 ` Michael Ellerman
0 siblings, 1 reply; 2+ messages in thread
From: alastair @ 2016-08-01 6:32 UTC (permalink / raw)
To: linuxppc-dev, mpe; +Cc: Alastair D'Silva
From: Alastair D'Silva <alastair@d-silva.org>
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.
---
arch/powerpc/platforms/pseries/hotplug-memory.c | 26 ++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 43f7beb..76ec104 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -320,19 +320,6 @@ static int dlpar_remove_device_tree_lmb(struct of_drconf_cell *lmb)
return dlpar_update_device_tree_lmb(lmb);
}
-static struct memory_block *lmb_to_memblock(struct of_drconf_cell *lmb)
-{
- unsigned long section_nr;
- struct mem_section *mem_sect;
- struct memory_block *mem_block;
-
- section_nr = pfn_to_section_nr(PFN_DOWN(lmb->base_addr));
- mem_sect = __nr_to_section(section_nr);
-
- mem_block = find_memory_block(mem_sect);
- return mem_block;
-}
-
#ifdef CONFIG_MEMORY_HOTREMOVE
static int pseries_remove_memblock(unsigned long base, unsigned int memblock_size)
{
@@ -420,6 +407,19 @@ static bool lmb_is_removable(struct of_drconf_cell *lmb)
static int dlpar_add_lmb(struct of_drconf_cell *);
+static struct memory_block *lmb_to_memblock(struct of_drconf_cell *lmb)
+{
+ unsigned long section_nr;
+ struct mem_section *mem_sect;
+ struct memory_block *mem_block;
+
+ section_nr = pfn_to_section_nr(PFN_DOWN(lmb->base_addr));
+ mem_sect = __nr_to_section(section_nr);
+
+ mem_block = find_memory_block(mem_sect);
+ return mem_block;
+}
+
static int dlpar_remove_lmb(struct of_drconf_cell *lmb)
{
struct memory_block *mem_block;
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: powerpc: Fix unused function warning 'lmb_to_memblock'
2016-08-01 6:32 [PATCH] powerpc: Fix unused function warning 'lmb_to_memblock' alastair
@ 2016-08-09 11:26 ` Michael Ellerman
0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2016-08-09 11:26 UTC (permalink / raw)
To: Alastair D'Silva, linuxppc-dev; +Cc: Alastair D'Silva
On Mon, 2016-01-08 at 06:32:51 UTC, Alastair D'Silva wrote:
> From: Alastair D'Silva <alastair@d-silva.org>
>
> 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.
Applied to powerpc fixes, thanks.
https://git.kernel.org/powerpc/c/9dc512819e4b723856773f5a01
cheers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-08-09 11:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-01 6:32 [PATCH] powerpc: Fix unused function warning 'lmb_to_memblock' alastair
2016-08-09 11:26 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).