Skip to contentSkip to conversation

mm/hotplug: use -EPERM instead of -1 for return value in online_pages()

PATCH New Jianguo Wu 1 participant 1 message Mar 22, 2013

Subsystems (2)
lore
Share & tools
lore

Jianguo Wu

author
#0 lore raw

PATCH 1/1 mm/hotplug: use -EPERM instead of -1 for return value in online_pages()

Cc Andrew Morton <[email protected]>
Cc Wen Congyang <[email protected]>
Cc Tang Chen <[email protected]>
Cc Jiang Liu <[email protected]>
Cc [email protected] (open list:MEMORY MANAGEMENT)
---
 mm/memory_hotplug.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
mm/memory_hotplug.c +5 -5
index b81a367b..07b6263 100644
@@ -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;
 		}
 	}
 
Signature · 8 lines
1.7.6.1


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