Skip to contentSkip to conversation

mm/compaction.c: Clean code by removing unnecessary assignment

PATCH Applied [email protected] 2 participants 2 messages Mar 18, 2020 – Mar 20, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/compaction.c: Clean code by removing unnecessary assignment

From: Mateusz Nosek <[email protected]>

Previously 0 was assigned to variable 'last_migrated_pfn'. But the variable is not read after that, so the assignment can be removed.

---
 mm/compaction.c | 1 -
 1 file changed, 1 deletion(-)
mm/compaction.c +0 -1
index 827d8a2b3164..4576d6c5afb5 100644
@@ -2183,7 +2183,6 @@ compact_zone(struct compact_control *cc, struct capture_control *capc)
 			ret = COMPACT_CONTENDED;
 			putback_movable_pages(&cc->migratepages);
 			cc->nr_migratepages = 0;
-			last_migrated_pfn = 0;
 			goto out;
 		case ISOLATE_NONE:
 			if (update_cached) {
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · On 3/18/20 6:45 PM, [email protected] wrote:

From: Mateusz Nosek <[email protected]>

Previously 0 was assigned to variable 'last_migrated_pfn'. But the variable is not read after that, so the assignment can be removed.

Quoted 17 lines
---
 mm/compaction.c | 1 -
 1 file changed, 1 deletion(-)
mm/compaction.c +0 -1
index 827d8a2b3164..4576d6c5afb5 100644
@@ -2183,7 +2183,6 @@ compact_zone(struct compact_control *cc, struct capture_control *capc)
 			ret = COMPACT_CONTENDED;
 			putback_movable_pages(&cc->migratepages);
 			cc->nr_migratepages = 0;
-			last_migrated_pfn = 0;
 			goto out;
 		case ISOLATE_NONE:
 			if (update_cached) {