Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7309562ybi; Wed, 5 Jun 2019 15:14:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZUFMEXbdZv9pbpFMuhKhBYHVHISwUs1Am5ilXdoKIdRFeSd2gxVVUUUM3xeyke15oUcQ2 X-Received: by 2002:a65:6495:: with SMTP id e21mr79153pgv.383.1559772876749; Wed, 05 Jun 2019 15:14:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559772876; cv=none; d=google.com; s=arc-20160816; b=Yk92WrmnYglilADIdgstnGyf7To9LNiUIb+kLlpKgGVOAL26zLxhHaLzg9rleym1zV Grzz41dL4uv0QWRXmmAm/p2kqEyyRdgGOVJdGZl+u4Aza4j1RYp/bZvspF1dTbfoATsl hO4zRYDX6ilxl9ZBxId3dqbiZeOodLCjhlF5n/qIH+RgAFTvbP35ezk0lpOszaO7ccO5 DZ0WGE1TQyceAc3nHOtsUdArtZnubBBuJ3MkhAHTKU2h1U5gxcJ6Xb1qQRV1kn44Y83B TpoAtrh2ogKmS9ibWAq4wWkhi6yPCyARtsOhnnPNF8x+wkr5cBYg0bdyIVdSFUqw8/Js mVYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject; bh=8n19+FzQaIDY2xDJy05T7UR8tvZJ9j4S/+ajqMgZvdY=; b=LAcp6esdyJ7YBgk1TCmhHHwTeeO+tKab13TbBpLOp95ysGoNrDUC0GnZaVkIZmHjJ9 +sGlTDK9wc4IdDNDrH2xxGgHLnEOKmBZOx0iMjLaRbmgXOh3lPTJ8tu9zaYCzG6CCFTE 2tXPCyps1ylp59WLsDzH4mKr41vNWWVVg0xc3nE3pOxllYrSbvD/bIklT/NnS6DwNXBv NBlHBqz7c2SIL+x9hQOzvG1T6XjFcK1Arw985hZA9CwmLF3nGvU321VC0bqZpxBp2Q+x toAHxZp2wgKw1MKmc5heiybd2Adp/Xf5xw1AyQaHjwDABriDmFTZLUbBydEDFT1wRSsl 4l3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2si44013pjv.73.2019.06.05.15.14.19; Wed, 05 Jun 2019 15:14:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726778AbfFEWMu (ORCPT + 99 others); Wed, 5 Jun 2019 18:12:50 -0400 Received: from mga07.intel.com ([134.134.136.100]:54517 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726757AbfFEWMt (ORCPT ); Wed, 5 Jun 2019 18:12:49 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jun 2019 15:12:49 -0700 X-ExtLoop1: 1 Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by orsmga008.jf.intel.com with ESMTP; 05 Jun 2019 15:12:49 -0700 Subject: [PATCH v9 06/12] mm: Kill is_dev_zone() helper From: Dan Williams To: akpm@linux-foundation.org Cc: Michal Hocko , Logan Gunthorpe , David Hildenbrand , Oscar Salvador , Pavel Tatashin , linux-mm@kvack.org, linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, osalvador@suse.de, mhocko@suse.com Date: Wed, 05 Jun 2019 14:58:32 -0700 Message-ID: <155977191260.2443951.15908146523735681570.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <155977186863.2443951.9036044808311959913.stgit@dwillia2-desk3.amr.corp.intel.com> References: <155977186863.2443951.9036044808311959913.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.18-2-gc94f MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Given there are no more usages of is_dev_zone() outside of 'ifdef CONFIG_ZONE_DEVICE' protection, kill off the compilation helper. Cc: Michal Hocko Cc: Logan Gunthorpe Acked-by: David Hildenbrand Reviewed-by: Oscar Salvador Reviewed-by: Pavel Tatashin Signed-off-by: Dan Williams --- include/linux/mmzone.h | 12 ------------ mm/page_alloc.c | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 6dd52d544857..49e7fb452dfd 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -855,18 +855,6 @@ static inline int local_memory_node(int node_id) { return node_id; }; */ #define zone_idx(zone) ((zone) - (zone)->zone_pgdat->node_zones) -#ifdef CONFIG_ZONE_DEVICE -static inline bool is_dev_zone(const struct zone *zone) -{ - return zone_idx(zone) == ZONE_DEVICE; -} -#else -static inline bool is_dev_zone(const struct zone *zone) -{ - return false; -} -#endif - /* * Returns true if a zone has pages managed by the buddy allocator. * All the reclaim decisions have to use this function rather than diff --git a/mm/page_alloc.c b/mm/page_alloc.c index bd773efe5b82..5dff3f49a372 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5865,7 +5865,7 @@ void __ref memmap_init_zone_device(struct zone *zone, unsigned long start = jiffies; int nid = pgdat->node_id; - if (WARN_ON_ONCE(!pgmap || !is_dev_zone(zone))) + if (WARN_ON_ONCE(!pgmap || zone_idx(zone) != ZONE_DEVICE)) return; /*