Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751524AbcC3Enz (ORCPT ); Wed, 30 Mar 2016 00:43:55 -0400 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:50911 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750959AbcC3Enx (ORCPT ); Wed, 30 Mar 2016 00:43:53 -0400 X-Original-SENDERIP: 156.147.1.151 X-Original-MAILFROM: chanho.min@lge.com X-Original-SENDERIP: 165.244.98.76 X-Original-MAILFROM: chanho.min@lge.com X-Original-SENDERIP: 165.186.175.97 X-Original-MAILFROM: chanho.min@lge.com From: Chanho Min To: Andrew Morton , Mel Gorman , Vlastimil Babka , David Rientjes , Michal Hocko , Dan Williams , Zhang Zhen CC: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Gunho Lee , Chanho Min Subject: [PATCH] mm/highmem: simplify is_highmem() Date: Wed, 30 Mar 2016 13:43:42 +0900 Message-ID: <1459313022-11750-1-git-send-email-chanho.min@lge.com> X-Mailer: git-send-email 1.7.9.5 X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB08/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/03/30 13:43:45, Serialize by Router on LGEKRMHUB08/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/03/30 13:43:45, Serialize complete at 2016/03/30 13:43:45 MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 914 Lines: 27 The is_highmem() is can be simplified by use of is_highmem_idx(). This patch removes redundant code and will make it easier to maintain if the zone policy is changed or a new zone is added. Signed-off-by: Chanho Min --- include/linux/mmzone.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index e23a9e7..9ac90c3 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -817,10 +817,7 @@ static inline int is_highmem_idx(enum zone_type idx) static inline int is_highmem(struct zone *zone) { #ifdef CONFIG_HIGHMEM - int zone_off = (char *)zone - (char *)zone->zone_pgdat->node_zones; - return zone_off == ZONE_HIGHMEM * sizeof(*zone) || - (zone_off == ZONE_MOVABLE * sizeof(*zone) && - zone_movable_is_highmem()); + return is_highmem_idx(zone_idx(zone)); #else return 0; #endif -- 1.7.9.5