* [PATCH] powerpc/pseries: fix error return value in cmm_mem_going_offline
@ 2016-03-08 21:26 Rasmus Villemoes
2016-07-05 14:10 ` Michael Ellerman
0 siblings, 1 reply; 2+ messages in thread
From: Rasmus Villemoes @ 2016-03-08 21:26 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
Cc: Rasmus Villemoes, linuxppc-dev, linux-kernel
cmm_mem_going_offline is (only) called from cmm_memory_cb(), which
sends the return value through notifier_from_errno(). The latter
expects 0 or -errno (notifier_to_errno(notifier_from_errno(x)) is 0
for any x >= 0, so passing a positive value cannot make sense). Hence
negate ENOMEM.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
arch/powerpc/platforms/pseries/cmm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/pseries/cmm.c b/arch/powerpc/platforms/pseries/cmm.c
index fc44ad0475f8..66e7227469b8 100644
--- a/arch/powerpc/platforms/pseries/cmm.c
+++ b/arch/powerpc/platforms/pseries/cmm.c
@@ -574,7 +574,7 @@ static int cmm_mem_going_offline(void *arg)
cmm_dbg("Failed to allocate memory for list "
"management. Memory hotplug "
"failed.\n");
- return ENOMEM;
+ return -ENOMEM;
}
memcpy(npa, pa_curr, PAGE_SIZE);
if (pa_curr == cmm_page_list)
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: powerpc/pseries: fix error return value in cmm_mem_going_offline
2016-03-08 21:26 [PATCH] powerpc/pseries: fix error return value in cmm_mem_going_offline Rasmus Villemoes
@ 2016-07-05 14:10 ` Michael Ellerman
0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2016-07-05 14:10 UTC (permalink / raw)
To: Rasmus Villemoes, Benjamin Herrenschmidt, Paul Mackerras
Cc: linuxppc-dev, Rasmus Villemoes, linux-kernel
On Tue, 2016-08-03 at 21:26:17 UTC, Rasmus Villemoes wrote:
> cmm_mem_going_offline is (only) called from cmm_memory_cb(), which
> sends the return value through notifier_from_errno(). The latter
> expects 0 or -errno (notifier_to_errno(notifier_from_errno(x)) is 0
> for any x >= 0, so passing a positive value cannot make sense). Hence
> negate ENOMEM.
>
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/e2be23712a9c8e3710c9e2684a
cheers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-07-05 14:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-08 21:26 [PATCH] powerpc/pseries: fix error return value in cmm_mem_going_offline Rasmus Villemoes
2016-07-05 14:10 ` 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).