From patchwork Sun Jun 24 18:25:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 10484727 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2C53D6019D for ; Sun, 24 Jun 2018 18:25:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 041572881E for ; Sun, 24 Jun 2018 18:25:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E89EA2883D; Sun, 24 Jun 2018 18:25:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 777E62881E for ; Sun, 24 Jun 2018 18:25:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D2CDC6B0005; Sun, 24 Jun 2018 14:25:39 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id CB50B6B0006; Sun, 24 Jun 2018 14:25:39 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B56F96B0007; Sun, 24 Jun 2018 14:25:39 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wm0-f69.google.com (mail-wm0-f69.google.com [74.125.82.69]) by kanga.kvack.org (Postfix) with ESMTP id 531706B0005 for ; Sun, 24 Jun 2018 14:25:39 -0400 (EDT) Received: by mail-wm0-f69.google.com with SMTP id x203-v6so3142908wmg.8 for ; Sun, 24 Jun 2018 11:25:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:mime-version:content-transfer-encoding; bh=duPysqsEARrBt16PQeAVpIhlwdrbEPT2gs++58e9tJ0=; b=r3GJecxv0BvD3jVKOuDfRSKw+gNsw4oi05aG8zDUT/Sgk5gNFTOU0rs6gBzKCtteH6 vdkOgczKg91ezIxgNOIJZO46SAGMj5GCOBU4mxZAlzAmbyzISRKYoMM6LP8R7QNOV3Y4 +kD1Dq3ijU6NuvIIOw1QpulppOkzrVVj2yPsjbNxGTVGWMgmDfdE6xA12dtvZWyyGyvt rtJ8dIfDa4Is6nBpR2C6yt0ITbL/RXRyvbd26ukarOUD2UzDrUiIa4bTzVdY4TW4NvM7 EXRjE39XMBHOM6Q4uL9uqAAA0pse64Vdq3Yze7agdTVyn1NPtJMqUHK5IFO654heqgC9 IZ/g== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of colin.king@canonical.com designates 91.189.89.112 as permitted sender) smtp.mailfrom=colin.king@canonical.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com X-Gm-Message-State: APt69E3JxK2zDBzW2Mye+RQLq7zxSLAqqC6bNtgC2Y8v8yttsVJwntVc dBic0zCkHh32dC81Uevmb5VWAQRyyGhDHaqvzxB01ySMdJW+qwW8rtSqYqxpf4tQ1dxCGrdaosj KWNIhM/EHTl+Oa51h2beyjRBLX19QXWrKHcIFDTcZaoGry6FMxvUJ0aydYzdayPJTig== X-Received: by 2002:adf:e285:: with SMTP id v5-v6mr7234431wri.54.1529864738766; Sun, 24 Jun 2018 11:25:38 -0700 (PDT) X-Google-Smtp-Source: AAOMgpenTZps7tgCR3S5JgfsdsABUNkgVJAk9nS7LD7SzC7DXE782MaXkJbUsknILQx6jQBMhN/H X-Received: by 2002:adf:e285:: with SMTP id v5-v6mr7234392wri.54.1529864737840; Sun, 24 Jun 2018 11:25:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529864737; cv=none; d=google.com; s=arc-20160816; b=LnKsPwkiC2DEp0ii3xfCFrDrD5PfG7fhKoZwrsF13yizTEacmw/GNuaNyvoM6uM9tt mW2E9Jf3UhYY4hNML8V3KN1UVJhkAY2kSutc/IrNZkMKKQbEPxh9Q/VKw/qdLS1n7Xv/ 3XHr6egPeYuzGbL2x5PzK6Oy01loXHlvGVbcyaNsoJY2Cpif9+zYdQdEolF9wRUHxZSY ZLNMatGjwdpJe9akdIY9BfgH8l3Ot4QdTc6leohK/oUsapfeGAwjH1gFUYzfyo7nvwkj SgIZBAPi06/8OtL368LsUOnJbiuEaCNsKjSCy5rx529Ams8ovcSLak+dx9ufUb+qx8KP V9Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=duPysqsEARrBt16PQeAVpIhlwdrbEPT2gs++58e9tJ0=; b=FOedErUmihVjQzIKZqT0os4EGuU9Nc51Zmv0jDY72SKrp7UlrWvIaYrXkLRsbG9b1G JfgrSbCvrbYh+n9l0FvHqbpyNcPYMxEZUJg++nlrHK1eOXcPrXOYrIEPPpuOBSFPTe+t +kV2hRejogYxFMwLn/XmLIOGUlppMLVe16mRDtNvd2wuiFfNlVhqGyQEPNhkJmCW94gt Hw+6e1tZCtlo2khhCBWBqO4XNbxXhouwuFY/XKMrgKMLzQ6XGMgeZnDaEDgUV/9D6ZCM DZw0NntlHjZ2oIGCmV85XCTqsRuq0JH7wlSW8z4EtcEJWBGTTdw5VQQDnEzU0cPfo7xy 0fsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of colin.king@canonical.com designates 91.189.89.112 as permitted sender) smtp.mailfrom=colin.king@canonical.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: from youngberry.canonical.com (youngberry.canonical.com. [91.189.89.112]) by mx.google.com with ESMTPS id t132-v6si329481wmb.31.2018.06.24.11.25.37 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 24 Jun 2018 11:25:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of colin.king@canonical.com designates 91.189.89.112 as permitted sender) client-ip=91.189.89.112; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of colin.king@canonical.com designates 91.189.89.112 as permitted sender) smtp.mailfrom=colin.king@canonical.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1fX9hh-0003Wr-5L; Sun, 24 Jun 2018 18:25:37 +0000 From: Colin King To: Andrew Morton , linux-mm@kvack.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm, swap: make swap_slots_cache_mutex and swap_slots_cache_enable_mutex static Date: Sun, 24 Jun 2018 19:25:36 +0100 Message-Id: <20180624182536.4937-1-colin.king@canonical.com> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: Colin Ian King The mutexes swap_slots_cache_mutex and swap_slots_cache_enable_mutex are local to the source and do not need to be in global scope, so make them static. Cleans up sparse warnings: symbol 'swap_slots_cache_mutex' was not declared. Should it be static? symbol 'swap_slots_cache_enable_mutex' was not declared. Should it be static? Signed-off-by: Colin Ian King --- mm/swap_slots.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/swap_slots.c b/mm/swap_slots.c index a791411fed71..008ccb22fee6 100644 --- a/mm/swap_slots.c +++ b/mm/swap_slots.c @@ -38,9 +38,9 @@ static DEFINE_PER_CPU(struct swap_slots_cache, swp_slots); static bool swap_slot_cache_active; bool swap_slot_cache_enabled; static bool swap_slot_cache_initialized; -DEFINE_MUTEX(swap_slots_cache_mutex); +static DEFINE_MUTEX(swap_slots_cache_mutex); /* Serialize swap slots cache enable/disable operations */ -DEFINE_MUTEX(swap_slots_cache_enable_mutex); +static DEFINE_MUTEX(swap_slots_cache_enable_mutex); static void __drain_swap_slots_cache(unsigned int type); static void deactivate_swap_slots_cache(void);