Skip to contentSkip to conversation

Remove unused variable from memory_hotplug.c

PATCH Applied [email protected] 2 participants 3 messages Jun 24, 2017 – Jun 27, 2017

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

cover Remove unused variable from memory_hotplug.c

From: John Hubbard <[email protected]>

Hi,

While poking around trying to understand Michal's "[PATCH -v4 0/14] mm: make movable onlining suck less", I noticed this minor thing, and the fix doesn't seem to conflict with any of the ongoing patchsets I've seen lately, so it seems harmless to just fix it.

This is patched against today's linux-next.

John Hubbard (1):
mm: remove unused zone_type variable from __remove_zone()

 mm/memory_hotplug.c | 3 ---
 1 file changed, 3 deletions(-)
Signature · 7 lines
2.13.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>
#1 lore raw

PATCH 1/1 mm: remove unused zone_type variable from __remove_zone()

From: John Hubbard <[email protected]>

__remove_zone() is setting up zone_type, but never using it for anything. This is not causing a warning, due to the (necessary) use of -Wno-unused-but-set-variable. However, it's noise, so just delete it.

---
 mm/memory_hotplug.c | 3 ---
 1 file changed, 3 deletions(-)
mm/memory_hotplug.c +0 -3
index 567a1dcafa1a..9bd73ecd7248 100644
@@ -580,11 +580,8 @@ static void __remove_zone(struct zone *zone, unsigned long start_pfn)
 {
 	struct pglist_data *pgdat = zone->zone_pgdat;
 	int nr_pages = PAGES_PER_SECTION;
-	int zone_type;
 	unsigned long flags;
 
-	zone_type = zone - pgdat->node_zones;
-
 	pgdat_resize_lock(zone->zone_pgdat, &flags);
 	shrink_zone_span(zone, start_pfn, start_pfn + nr_pages);
 	shrink_pgdat_span(pgdat, start_pfn, start_pfn + nr_pages);
Signature · 7 lines
2.13.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>
Acked-by on v1 1/1
#2 lore raw

Re: [PATCH 1/1] mm: remove unused zone_type variable from __remove_zone()

Quoted 6 lines · On Fri 23-06-17 21:34:21, [email protected] wrote:

From: John Hubbard <[email protected]>

__remove_zone() is setting up zone_type, but never using it for anything. This is not causing a warning, due to the (necessary) use of -Wno-unused-but-set-variable. However, it's noise, so just delete it.

I plan to remove the function completely FWIW but this is a trivial impovement.

Quoted 1 line
Quoted 22 lines
---
 mm/memory_hotplug.c | 3 ---
 1 file changed, 3 deletions(-)
mm/memory_hotplug.c +0 -3
index 567a1dcafa1a..9bd73ecd7248 100644
@@ -580,11 +580,8 @@ static void __remove_zone(struct zone *zone, unsigned long start_pfn)
 {
 	struct pglist_data *pgdat = zone->zone_pgdat;
 	int nr_pages = PAGES_PER_SECTION;
-	int zone_type;
 	unsigned long flags;
 
-	zone_type = zone - pgdat->node_zones;
-
 	pgdat_resize_lock(zone->zone_pgdat, &flags);
 	shrink_zone_span(zone, start_pfn, start_pfn + nr_pages);
 	shrink_pgdat_span(pgdat, start_pfn, start_pfn + nr_pages);
Signature · 1 line
2.13.1
Signature · 8 lines
Michal Hocko
SUSE Labs

--
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>