Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2180798pxj; Thu, 20 May 2021 01:52:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxppC043qQW+W53gfxnAc+luCF6LxOFYrRjWit4R1yaTyoKVkKRdP91mzDTiNUcl3IdoEvU X-Received: by 2002:a17:907:105e:: with SMTP id oy30mr3576428ejb.258.1621500745645; Thu, 20 May 2021 01:52:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621500745; cv=none; d=google.com; s=arc-20160816; b=0EN6E897Irw1wvSj7kKTqCQk8e/1q4ljU6nUtgPOx4oev7HZpbN0oiR4bposi38Puq NfTp34B++7sHiO0Isv/86jJdQTOsvCD+nGXVtmgatuwFY9cZio7yzpvA7xbMhLWJEwkP rAMZdO42ODtbR53+NeJkdy6m//Qfvi/1U7K2Q3xLGiW+PtXbe+wwvh2vu5v7CZvrvPP9 TMx0fSZtthDperrS4RfWoMdcq135GnvuoUJKl/h825dQPZSL2No97bJLImlS7bFh0jc0 qcuje3qC7YzchVQ49R0GZCGCffWx9mTv9ztYX0yXhKSr4N9K5kD7h3U6uW0zz7AoaPur ku2g== 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=RchVFKajxKE16rWAlXrvd4Qu1h+4dFHbcG1X5ua//Tw=; b=wn9vvgY9uxcCbsgnPyw9mAtrVCwbVleD6yMFU0sxHm6IlHMwtbgfFqjfo9PdB/6ECW V8fAzX/fRWqcG42vKmCFOsWnC2iZ1CK79CPUuRy8+GwK+KROlX8iWwVEv/ZOsRCeGNlR VHC7LGcAkZM4Qo3MZvUcKPzwSJI8B57qFUCiGh0tyyUQ+GeLTbSb8KhY6QByRhwn3bbb ABh9We+q7r71k8cKjy42FbeG2kKWHYShaSLjSEDp/5Ji5GSTF7qgrAbqW/wwOFjuUtGc kmYPjwWiUK0szEanN+Z+XvN7gnaQeK+kANsuQZQuEl45QGQYlqp+e7FA/ddAtMwdBiE7 2lQA== 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 s25si2029148ejx.655.2021.05.20.01.52.02; Thu, 20 May 2021 01:52:25 -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 S231381AbhETIvk (ORCPT + 99 others); Thu, 20 May 2021 04:51:40 -0400 Received: from outbound-smtp37.blacknight.com ([46.22.139.220]:58273 "EHLO outbound-smtp37.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230469AbhETIvk (ORCPT ); Thu, 20 May 2021 04:51:40 -0400 Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp37.blacknight.com (Postfix) with ESMTPS id 552A21A52 for ; Thu, 20 May 2021 09:50:18 +0100 (IST) Received: (qmail 9881 invoked from network); 20 May 2021 08:50:17 -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:17 -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 11/14] mm/swap: Make swap_address_space an inline function Date: Thu, 20 May 2021 09:48:06 +0100 Message-Id: <20210520084809.8576-12-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 page_mapping() for allnoconfig mm/util.c:700:15: warning: variable ‘entry’ set but not used [-Wunused-but-set-variable] swp_entry_t entry; ^~~~~ swap_address is a #define on !CONFIG_SWAP configurations. 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/swap.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/linux/swap.h b/include/linux/swap.h index 144727041e78..216462c78a91 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -526,7 +526,11 @@ static inline struct swap_info_struct *swp_swap_info(swp_entry_t entry) return NULL; } -#define swap_address_space(entry) (NULL) +static inline struct address_space *swap_address_space(swp_entry_t entry) +{ + return NULL; +} + #define get_nr_swap_pages() 0L #define total_swap_pages 0L #define total_swapcache_pages() 0UL -- 2.26.2