All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jianguo Wu <wujianguo@huawei.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Wen Congyang <wency@cn.fujitsu.com>,
	Tang Chen <tangchen@cn.fujitsu.com>,
	Liujiang <jiang.liu@huawei.com>,
	linux-mm@kvack.org, qiuxishi <qiuxishi@huawei.com>
Subject: [PATCH] mm/hotplug: use -EPERM instead of -1 for return value in online_pages()
Date: Fri, 22 Mar 2013 11:56:06 +0800	[thread overview]
Message-ID: <514BD656.2060307@huawei.com> (raw)

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Wen Congyang <wency@cn.fujitsu.com>
Cc: Tang Chen <tangchen@cn.fujitsu.com>
Cc: Jiang Liu <jiang.liu@huawei.com>
Cc: linux-mm@kvack.org (open list:MEMORY MANAGEMENT)
Signed-off-by: Jianguo Wu <wujianguo@huawei.com>
---
 mm/memory_hotplug.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index b81a367b..07b6263 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -332,7 +332,7 @@ static int __meminit move_pfn_range_left(struct zone *z1, struct zone *z2,
 	return 0;
 out_fail:
 	pgdat_resize_unlock(z1->zone_pgdat, &flags);
-	return -1;
+	return -EPERM;
 }
 
 static int __meminit move_pfn_range_right(struct zone *z1, struct zone *z2,
@@ -374,7 +374,7 @@ static int __meminit move_pfn_range_right(struct zone *z1, struct zone *z2,
 	return 0;
 out_fail:
 	pgdat_resize_unlock(z1->zone_pgdat, &flags);
-	return -1;
+	return -EPERM;
 }
 
 static void grow_pgdat_span(struct pglist_data *pgdat, unsigned long start_pfn,
@@ -924,19 +924,19 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ
 	if ((zone_idx(zone) > ZONE_NORMAL || online_type == ONLINE_MOVABLE) &&
 	    !can_online_high_movable(zone)) {
 		unlock_memory_hotplug();
-		return -1;
+		return -EPERM;
 	}
 
 	if (online_type == ONLINE_KERNEL && zone_idx(zone) == ZONE_MOVABLE) {
 		if (move_pfn_range_left(zone - 1, zone, pfn, pfn + nr_pages)) {
 			unlock_memory_hotplug();
-			return -1;
+			return -EPERM;
 		}
 	}
 	if (online_type == ONLINE_MOVABLE && zone_idx(zone) == ZONE_MOVABLE - 1) {
 		if (move_pfn_range_right(zone, zone + 1, pfn, pfn + nr_pages)) {
 			unlock_memory_hotplug();
-			return -1;
+			return -EPERM;
 		}
 	}
 
-- 
1.7.6.1


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

                 reply	other threads:[~2013-03-22  3:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=514BD656.2060307@huawei.com \
    --to=wujianguo@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=jiang.liu@huawei.com \
    --cc=linux-mm@kvack.org \
    --cc=qiuxishi@huawei.com \
    --cc=tangchen@cn.fujitsu.com \
    --cc=wency@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.