Skip to content

Commit

Permalink
vmscan: remove unnecessary temporary vars in do_try_to_free_pages
Browse files Browse the repository at this point in the history
Remove temporary variable that is only used once and does not help clarify
code.

[[email protected]: coding-style fixes]
Signed-off-by: Mel Gorman <[email protected]>
Reviewed-by: Rik van Riel <[email protected]>
Cc: Dave Chinner <[email protected]>
Cc: Chris Mason <[email protected]>
Cc: Nick Piggin <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: KAMEZAWA Hiroyuki <[email protected]>
Cc: KOSAKI Motohiro <[email protected]>
Cc: Andrea Arcangeli <[email protected]>
Cc: Michael Rubin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
gormanm authored and torvalds committed Aug 10, 2010
1 parent e247dbc commit d4debc6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1728,13 +1728,12 @@ static void shrink_zone(int priority, struct zone *zone,
static bool shrink_zones(int priority, struct zonelist *zonelist,
struct scan_control *sc)
{
enum zone_type high_zoneidx = gfp_zone(sc->gfp_mask);
struct zoneref *z;
struct zone *zone;
bool all_unreclaimable = true;

for_each_zone_zonelist_nodemask(zone, z, zonelist, high_zoneidx,
sc->nodemask) {
for_each_zone_zonelist_nodemask(zone, z, zonelist,
gfp_zone(sc->gfp_mask), sc->nodemask) {
if (!populated_zone(zone))
continue;
/*
Expand Down Expand Up @@ -1779,7 +1778,6 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist,
struct reclaim_state *reclaim_state = current->reclaim_state;
struct zoneref *z;
struct zone *zone;
enum zone_type high_zoneidx = gfp_zone(sc->gfp_mask);
unsigned long writeback_threshold;

get_mems_allowed();
Expand All @@ -1799,7 +1797,8 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist,
*/
if (scanning_global_lru(sc)) {
unsigned long lru_pages = 0;
for_each_zone_zonelist(zone, z, zonelist, high_zoneidx) {
for_each_zone_zonelist(zone, z, zonelist,
gfp_zone(sc->gfp_mask)) {
if (!cpuset_zone_allowed_hardwall(zone, GFP_KERNEL))
continue;

Expand Down

0 comments on commit d4debc6

Please sign in to comment.