Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754879Ab3GOKIJ (ORCPT ); Mon, 15 Jul 2013 06:08:09 -0400 Received: from lgeamrelo02.lge.com ([156.147.1.126]:57535 "EHLO LGEAMRELO02.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754837Ab3GOKII (ORCPT ); Mon, 15 Jul 2013 06:08:08 -0400 X-AuditID: 9c93017e-b7b62ae000000eeb-e1-51e3c671df7d From: Joonsoo Kim To: Andrew Morton Cc: Rik van Riel , Mel Gorman , Michal Hocko , "Aneesh Kumar K.V" , KAMEZAWA Hiroyuki , Hugh Dickins , Davidlohr Bueso , David Gibson , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Joonsoo Kim , Joonsoo Kim Subject: [PATCH 5/9] mm, hugetlb: remove redundant list_empty check in gather_surplus_pages() Date: Mon, 15 Jul 2013 18:52:43 +0900 Message-Id: <1373881967-16153-6-git-send-email-iamjoonsoo.kim@lge.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1373881967-16153-1-git-send-email-iamjoonsoo.kim@lge.com> References: <1373881967-16153-1-git-send-email-iamjoonsoo.kim@lge.com> X-Brightmail-Tracker: AAAAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 885 Lines: 30 If list is empty, list_for_each_entry_safe() doesn't do anything. So, this check is redundant. Remove it. Signed-off-by: Joonsoo Kim diff --git a/mm/hugetlb.c b/mm/hugetlb.c index a838e6b..d4a1695 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1019,10 +1019,8 @@ free: spin_unlock(&hugetlb_lock); /* Free unnecessary surplus pages to the buddy allocator */ - if (!list_empty(&surplus_list)) { - list_for_each_entry_safe(page, tmp, &surplus_list, lru) { - put_page(page); - } + list_for_each_entry_safe(page, tmp, &surplus_list, lru) { + put_page(page); } spin_lock(&hugetlb_lock); -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/