Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2181325pxj; Thu, 20 May 2021 01:53:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVlhl6vhi8cl0mff6h+5GnAMDKpAn0I85zcCf50h6B0ILPip5xq1vKzfJmB3SkTajiQK09 X-Received: by 2002:a17:906:e09:: with SMTP id l9mr3541981eji.528.1621500803665; Thu, 20 May 2021 01:53:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621500803; cv=none; d=google.com; s=arc-20160816; b=eHufAcoCwfToufhEDgEMgiaXHdGpyGhFCrsEja5VLPcp2WE9r9+txyJQcmd98ZIDEy 9nF8ucNdcWN+9RhzPnwFVmTZEbHkMXSvo9reITVS/Q87kaCHyYUQOXerQKh/7dW/BdiY /T9bsmP+ut8/2PZT90tHp4PdL9Esv0/5KC3eDAnqtbgqUwKnHW6ilWdX4BfTFALfpYPS 1n2o0mBFDy45tWadcVPP6pBXfXkyJbqwJxIMGtBvgy4OGsceeM6iPxxFcit9SYy+qpeR BhLmhim/e8kqOdaiBNk3dsfz4lgFcw1TnI7u7q8UTNwFxR9IpfxRI7umHhR8mXlUruvh wBhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=y8rE6/Nrrr+4Q/Pt1IKP9YAX6Wd8XEcn1/b3cOMedWQ=; b=k+DXxgkuEdo3BA2D1DIZhqu6kW41RGl4IFGpE1ZnsQB8JcBHLUHmUMMhQy4eG+WHqK PBv5TAs+xQGCFbqiQTmatOhXuvUlA2ggi0iAF8W6VS99jqcRpCC+7CEjlYw6TiikYcfO eBbJvlwAhNkkV1Rv6hxjVZD90aYjPb34aCDIOgNNvCSaz185cLigURcEyTpXuIb9Gtge Qlp4bXhcanevkGF6JGXKWCchQanXVfr5FguvFhupMqSZPFL124NgV1U/QvhWkWTLVWpH A/M8NOQQbXEXbJ0boEADtnbYb+OPCGhcjtKdlkTp5GWi3XLumbUQTcSC0ua6tb8j6AHQ i+Uw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v8si2089042ede.125.2021.05.20.01.53.00; Thu, 20 May 2021 01:53:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231236AbhETIwM (ORCPT + 99 others); Thu, 20 May 2021 04:52:12 -0400 Received: from outbound-smtp57.blacknight.com ([46.22.136.241]:35867 "EHLO outbound-smtp57.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229536AbhETIwL (ORCPT ); Thu, 20 May 2021 04:52:11 -0400 Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp57.blacknight.com (Postfix) with ESMTPS id 9B296FAB59 for ; Thu, 20 May 2021 09:50:49 +0100 (IST) Received: (qmail 11710 invoked from network); 20 May 2021 08:50:49 -0000 Received: from unknown (HELO stampy.112glenside.lan) (mgorman@techsingularity.net@[84.203.23.168]) by 81.17.254.9 with ESMTPA; 20 May 2021 08:50:49 -0000 From: Mel Gorman To: Andrew Morton Cc: Michal Hocko , David Hildenbrand , Vlastimil Babka , Dan Streetman , Yang Shi , Linux-MM , LKML , Mel Gorman Subject: [PATCH 14/14] mm/swap: Make NODE_DATA an inline function on CONFIG_FLATMEM Date: Thu, 20 May 2021 09:48:09 +0100 Message-Id: <20210520084809.8576-15-mgorman@techsingularity.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210520084809.8576-1-mgorman@techsingularity.net> References: <20210520084809.8576-1-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org make W=1 generates the following warning in mm/workingset.c for allnoconfig mm/workingset.c: In function ‘unpack_shadow’: mm/workingset.c:201:15: warning: variable ‘nid’ set but not used [-Wunused-but-set-variable] int memcgid, nid; ^~~ On FLATMEM, NODE_DATA returns a global pglist_data without dereferencing nid. Make the helper an inline function to suppress the warning, add type checking and to apply any side-effects in the parameter list. Signed-off-by: Mel Gorman --- include/linux/mmzone.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 0d53eba1c383..8af2f9ff9737 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -1044,7 +1044,10 @@ extern char numa_zonelist_order[]; #ifndef CONFIG_NEED_MULTIPLE_NODES extern struct pglist_data contig_page_data; -#define NODE_DATA(nid) (&contig_page_data) +static inline struct pglist_data *NODE_DATA(int nid) +{ + return &contig_page_data; +} #define NODE_MEM_MAP(nid) mem_map #else /* CONFIG_NEED_MULTIPLE_NODES */ -- 2.26.2