From patchwork Sun Jun 24 21:33:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 10484873 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 46C1A6023A for ; Sun, 24 Jun 2018 21:33:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 291E52654B for ; Sun, 24 Jun 2018 21:33:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1BAC22852D; Sun, 24 Jun 2018 21:33:29 +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 9989B2654B for ; Sun, 24 Jun 2018 21:33:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 218AD6B0010; Sun, 24 Jun 2018 17:33:27 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 1C8C36B0266; Sun, 24 Jun 2018 17:33:27 -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 0B8546B0269; Sun, 24 Jun 2018 17:33:27 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wm0-f71.google.com (mail-wm0-f71.google.com [74.125.82.71]) by kanga.kvack.org (Postfix) with ESMTP id A3D786B0010 for ; Sun, 24 Jun 2018 17:33:26 -0400 (EDT) Received: by mail-wm0-f71.google.com with SMTP id q8-v6so3244167wmc.2 for ; Sun, 24 Jun 2018 14:33:26 -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=SmaYDsOG3LSo3+NAfVZ5cyhgLfJTXWRYQIz5psoIiiA=; b=Yif8MczXhao3Vq39+Hs+hY1FXsgythKG72OH7n/t+YjIbw/IZ2MBppA7fkGbyoNjBM YFg0lZzmw7qOzC1hT4oRzgekAFS7WG8Y2PQWZwZSg5sCVwZxQp7SEwgH5YNz+LcuOO84 73+i2gZ538VQq0135kib3hlZ7bw6xYyuriX+dHkfbMYPuAWsScu4WPjJWn+Jc3sSd0ul yZBZLoF34NiiYhT2QD/bdPkANC+C1Uqa3uSTeE6nBavYIfnhghPY0jIt372XS9Z95Wzh Vs9eX+eobose8AFzwtaWOZSuyiT7UR0YKsh4+5G8SMazy5FQ4iZ1fCWfWKy/b26yrLR6 KqGQ== 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: APt69E0VD+piR/c5KWDtF/W4/hOd/pBljZVDwVwlH4IAHB66Bz83DLwv bIPJbnkkUZObRcoVkAU8q5F0j6EbNXIjSZFxq0o671+Uu5tr1t0RRNgaH6ghU1T9/NdJJNJs5mT 262eMdOPbplZonNdngdMELbacBu2C+JgB7SXKQBcJO6QQKELMeJ6AjOPCKb1flvgPwg== X-Received: by 2002:a1c:6954:: with SMTP id e81-v6mr7595881wmc.124.1529876006006; Sun, 24 Jun 2018 14:33:26 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfy/ops9puTTBBNn3MQlcFdzbKkhGuXpDxNFm+HXwsUDN+NxDv5T9GaytaJH8ve4BR0Xt82 X-Received: by 2002:a1c:6954:: with SMTP id e81-v6mr7595861wmc.124.1529876005076; Sun, 24 Jun 2018 14:33:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529876005; cv=none; d=google.com; s=arc-20160816; b=ltAa7UO3Hm+KRn+l6qzMlzEMHaQXlfoNoF5mZDOuCsnNnPjegkx0dvAM62nYxyZdZs Ytxcb2zFhYTC9FZnLp1l4YQ8CsMK1k9exL0/t//D7DRVxzSqsRoJtMJdNXKByWWLhvB6 TpVX4jlvra6eq/6c+Qg1WnNQQ6k903kj+J6xckqPOfiPzyASz3OXzFrmaCWCMj9yHhFo jBxmmBkhhF+9RTHwyLYl5XeVTohGKrjdepbxqNBo7divJ2p98XqEQdzq6pbXU2B1R3DG heI0QbQRyKg5GB9f/cT8Bs8DFSZgjyLhCaa1bMTmdFP5ecSMe6Cp2XKT4nDube0AIEUK muEg== 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=SmaYDsOG3LSo3+NAfVZ5cyhgLfJTXWRYQIz5psoIiiA=; b=f0m7GoxAmwVEsA+PmuPM2r2PrD26MYXzXh9ZK1+yUg2A8cYtYgcDh8Iv2BvQ1ijVGZ /WX4JSbRbgf3iOs4dXPvVzI2Z4rNsS8gM9rwWh/12lj48kEf/54msvOBN3Y32vO+bond lMwkva0V4xMqV6e485dkNZdaF2L7r6t3pi1kPERQ+SYF578qouoflQAXqhAcvc67e0z0 kRYbpnzzQWkCG7Mi6rKQEiw8NK9GUjXC1Hx++FmBF12PlW4gybs3hUmKhqkjdCNl31Bm XyoO9F/3p0Hc4BIbb6CwepE93iektJHGMl1VAqUMIN7aEDPG4nDymyTrPjuy2DiLC0Jo XJKQ== 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 p196-v6si1843825wmg.96.2018.06.24.14.33.24 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 24 Jun 2018 14:33:25 -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 1fXCdP-00025r-09; Sun, 24 Jun 2018 21:33:23 +0000 From: Colin King To: Minchan Kim , Nitin Gupta , Sergey Senozhatsky , linux-mm@kvack.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm/zsmalloc: make several functions and a struct static Date: Sun, 24 Jun 2018 22:33:22 +0100 Message-Id: <20180624213322.13776-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 functions zs_page_isolate, zs_page_migrate, zs_page_putback, lock_zspage, trylock_zspage and structure zsmalloc_aops are local to source and do not need to be in global scope, so make them static. Cleans up sparse warnings: symbol 'zs_page_isolate' was not declared. Should it be static? symbol 'zs_page_migrate' was not declared. Should it be static? symbol 'zs_page_putback' was not declared. Should it be static? symbol 'zsmalloc_aops' was not declared. Should it be static? symbol 'lock_zspage' was not declared. Should it be static? symbol 'trylock_zspage' was not declared. Should it be static? Signed-off-by: Colin Ian King Reviewed-by: Sergey Senozhatsky --- mm/zsmalloc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index a1a9debb6fc8..900bea99452a 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -928,7 +928,7 @@ static void reset_page(struct page *page) * To prevent zspage destroy during migration, zspage freeing should * hold locks of all pages in the zspage. */ -void lock_zspage(struct zspage *zspage) +static void lock_zspage(struct zspage *zspage) { struct page *page = get_first_page(zspage); @@ -937,7 +937,7 @@ void lock_zspage(struct zspage *zspage) } while ((page = get_next_page(page)) != NULL); } -int trylock_zspage(struct zspage *zspage) +static int trylock_zspage(struct zspage *zspage) { struct page *cursor, *fail; @@ -1906,7 +1906,7 @@ static void replace_sub_page(struct size_class *class, struct zspage *zspage, __SetPageMovable(newpage, page_mapping(oldpage)); } -bool zs_page_isolate(struct page *page, isolate_mode_t mode) +static bool zs_page_isolate(struct page *page, isolate_mode_t mode) { struct zs_pool *pool; struct size_class *class; @@ -1961,7 +1961,7 @@ bool zs_page_isolate(struct page *page, isolate_mode_t mode) return true; } -int zs_page_migrate(struct address_space *mapping, struct page *newpage, +static int zs_page_migrate(struct address_space *mapping, struct page *newpage, struct page *page, enum migrate_mode mode) { struct zs_pool *pool; @@ -2077,7 +2077,7 @@ int zs_page_migrate(struct address_space *mapping, struct page *newpage, return ret; } -void zs_page_putback(struct page *page) +static void zs_page_putback(struct page *page) { struct zs_pool *pool; struct size_class *class; @@ -2109,7 +2109,7 @@ void zs_page_putback(struct page *page) spin_unlock(&class->lock); } -const struct address_space_operations zsmalloc_aops = { +static const struct address_space_operations zsmalloc_aops = { .isolate_page = zs_page_isolate, .migratepage = zs_page_migrate, .putback_page = zs_page_putback,