From patchwork Sat Jun 19 02:55:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12332531 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA13DC48BE8 for ; Sat, 19 Jun 2021 02:56:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 620DC60041 for ; Sat, 19 Jun 2021 02:56:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 620DC60041 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DC5376B0070; Fri, 18 Jun 2021 22:56:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D4E746B0072; Fri, 18 Jun 2021 22:56:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BC86A6B0073; Fri, 18 Jun 2021 22:56:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0164.hostedemail.com [216.40.44.164]) by kanga.kvack.org (Postfix) with ESMTP id 86CBF6B0070 for ; Fri, 18 Jun 2021 22:56:09 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 296E9180AD804 for ; Sat, 19 Jun 2021 02:56:09 +0000 (UTC) X-FDA: 78268959258.29.FFD5627 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf02.hostedemail.com (Postfix) with ESMTP id 521D24211084 for ; Sat, 19 Jun 2021 02:56:08 +0000 (UTC) Received: from dggeme703-chm.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4G6Kzj1gypz1BP4Z; Sat, 19 Jun 2021 10:50:57 +0800 (CST) Received: from huawei.com (10.175.104.170) by dggeme703-chm.china.huawei.com (10.1.199.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Sat, 19 Jun 2021 10:56:01 +0800 From: Miaohe Lin To: , , , CC: , , Subject: [PATCH] mm/zbud: fix unused function warnings when CONFIG_ZPOOL is disabled Date: Sat, 19 Jun 2021 10:55:08 +0800 Message-ID: <20210619025508.1239386-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Originating-IP: [10.175.104.170] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggeme703-chm.china.huawei.com (10.1.199.99) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 521D24211084 Authentication-Results: imf02.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=huawei.com; spf=pass (imf02.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Stat-Signature: tn38odkpn5ipc4nqh8w4ebhzpoh519x3 X-HE-Tag: 1624071368-767691 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: There are several -Wunused-function warnings when CONFIG_ZPOOL is disabled. As zbud won't do anything when CONFIG_ZPOOL is disabled, we can make zbud depends on ZPOOL and eliminate the CONFIG_ZPOOL macro in zbud.c to fix these warnings. Fixes: 962b7e9ad124 ("mm/zbud: don't export any zbud API") Reported-by: Nathan Chancellor Signed-off-by: Miaohe Lin --- Hi, Andrew: Please feel free to merge this patch with mm-zbud-dont-export-any-zbud-api.patch. Many thanks! --- mm/Kconfig | 1 + mm/zbud.c | 10 ---------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/mm/Kconfig b/mm/Kconfig index 8f748010f7ea..5dc28e9205e0 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -674,6 +674,7 @@ config ZPOOL config ZBUD tristate "Low (Up to 2x) density storage for compressed pages" + depends on ZPOOL help A special purpose allocator for storing compressed pages. It is designed to store up to two compressed pages per physical diff --git a/mm/zbud.c b/mm/zbud.c index 3f61304405cb..6348932430b8 100644 --- a/mm/zbud.c +++ b/mm/zbud.c @@ -111,10 +111,8 @@ struct zbud_pool { struct list_head lru; u64 pages_nr; const struct zbud_ops *ops; -#ifdef CONFIG_ZPOOL struct zpool *zpool; const struct zpool_ops *zpool_ops; -#endif }; /* @@ -526,8 +524,6 @@ static u64 zbud_get_pool_size(struct zbud_pool *pool) * zpool ****************/ -#ifdef CONFIG_ZPOOL - static int zbud_zpool_evict(struct zbud_pool *pool, unsigned long handle) { if (pool->zpool && pool->zpool_ops && pool->zpool_ops->evict) @@ -618,7 +614,6 @@ static struct zpool_driver zbud_zpool_driver = { }; MODULE_ALIAS("zpool-zbud"); -#endif /* CONFIG_ZPOOL */ static int __init init_zbud(void) { @@ -626,19 +621,14 @@ static int __init init_zbud(void) BUILD_BUG_ON(sizeof(struct zbud_header) > ZHDR_SIZE_ALIGNED); pr_info("loaded\n"); -#ifdef CONFIG_ZPOOL zpool_register_driver(&zbud_zpool_driver); -#endif return 0; } static void __exit exit_zbud(void) { -#ifdef CONFIG_ZPOOL zpool_unregister_driver(&zbud_zpool_driver); -#endif - pr_info("unloaded\n"); }