Skip to content

Commit

Permalink
mm, page_alloc: remove unnecessary initialisation from __alloc_pages_…
Browse files Browse the repository at this point in the history
…nodemask()

page is guaranteed to be set before it is read with or without the
initialisation.

[[email protected]: fix warning]
Signed-off-by: Mel Gorman <[email protected]>
Acked-by: Vlastimil Babka <[email protected]>
Cc: Jesper Dangaard Brouer <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
gormanm authored and torvalds committed May 20, 2016
1 parent be06af0 commit 5bb1b16
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3347,7 +3347,7 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
struct zonelist *zonelist, nodemask_t *nodemask)
{
struct zoneref *preferred_zoneref;
struct page *page = NULL;
struct page *page;
unsigned int cpuset_mems_cookie;
unsigned int alloc_flags = ALLOC_WMARK_LOW|ALLOC_FAIR;
gfp_t alloc_mask; /* The gfp_t that was actually used for allocation */
Expand Down Expand Up @@ -3393,8 +3393,11 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
/* The preferred zone is used for statistics later */
preferred_zoneref = first_zones_zonelist(ac.zonelist, ac.high_zoneidx,
ac.nodemask, &ac.preferred_zone);
if (!ac.preferred_zone)
if (!ac.preferred_zone) {
page = NULL;
goto out;
}

ac.classzone_idx = zonelist_zone_idx(preferred_zoneref);

/* First allocation attempt */
Expand Down

0 comments on commit 5bb1b16

Please sign in to comment.