From patchwork Fri Sep 22 10:07:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiapeng Chong X-Patchwork-Id: 13395488 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52169CD4F4B for ; Fri, 22 Sep 2023 10:08:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AB0AA6B02AE; Fri, 22 Sep 2023 06:08:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A39E96B02AF; Fri, 22 Sep 2023 06:08:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9012E6B02B0; Fri, 22 Sep 2023 06:08:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 7C3966B02AE for ; Fri, 22 Sep 2023 06:08:08 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 51223B444A for ; Fri, 22 Sep 2023 10:08:08 +0000 (UTC) X-FDA: 81263807856.11.00E0427 Received: from out30-113.freemail.mail.aliyun.com (out30-113.freemail.mail.aliyun.com [115.124.30.113]) by imf27.hostedemail.com (Postfix) with ESMTP id 3F3544002F for ; Fri, 22 Sep 2023 10:08:03 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of jiapeng.chong@linux.alibaba.com designates 115.124.30.113 as permitted sender) smtp.mailfrom=jiapeng.chong@linux.alibaba.com; dmarc=pass (policy=none) header.from=alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695377286; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=aZFXVjXPEOOS8bf8KQF9DqY4JHI2zwJ7+3DN+vMNIcE=; b=xRR1uN1Z/ldRQOVYis0N4UShqxtFX1a4jF7mKiKBTJ/9l7CsF3To3sW32omm+8GTlHCq6b B89D5CFWLZsqLrRMYn/TBZYc4RnYMgfVveJRJtbJl/e5P+oShEs22dt0DbhQtmuOiAh5PC rU1WH/5Trw+iLirbe5NrGx+WWnwYNRA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1695377286; a=rsa-sha256; cv=none; b=FxCznBM2wuTp8yZkmpIQ72XTNpZNymNN3O9BsAuNiKgNBNiUcKIdD4o5eiP3/duv6FYpRF 6/Q9qQk9R5jZmC9NrTDNWu3JyRfRh+KNW/BEqVfsoOKNkhlYwhQi3uSOz14uNGfi/97haq KmVOzmtJRge7gQHBK7+7jo4TV7rG2VY= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of jiapeng.chong@linux.alibaba.com designates 115.124.30.113 as permitted sender) smtp.mailfrom=jiapeng.chong@linux.alibaba.com; dmarc=pass (policy=none) header.from=alibaba.com X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R201e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046060;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0Vsd76ZS_1695377268; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0Vsd76ZS_1695377268) by smtp.aliyun-inc.com; Fri, 22 Sep 2023 18:07:59 +0800 From: Jiapeng Chong To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Jiapeng Chong , Abaci Robot Subject: [PATCH] mm/list_lru: Remove unused function Date: Fri, 22 Sep 2023 18:07:47 +0800 Message-Id: <20230922100747.17045-1-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 X-Rspamd-Queue-Id: 3F3544002F X-Rspam-User: X-Stat-Signature: 751zj5x7j48rjst1b4nz6phwqfdwe4tz X-Rspamd-Server: rspam03 X-HE-Tag: 1695377283-77892 X-HE-Meta: U2FsdGVkX19XS+PpAHSmhdbyov9jmQ0cZczzSxTa3LDguxcKQnBbTb/5XxO94iPg5hShAAKhl2uyRs8pSOYyxg1NOSaPX9MSR4YjxANFFZGEWBvjl2OQ6tqUVcX46UFlQdjNrv46eElF6tOwELh9gGNwv6s/yYWjCJ4IOLJHlhfFgQzJSmJyWdj1A2DLVtdLrQAHo7C118G2XxZldIFZ0OjqRamAbKyZk9FouQqqUA2NX3zviy2kVV7mEDihMtDZnOEwzD5dRW0nCzPOC6S6wM8gNPLfX/hMPgPCIc/ZQOOEyb63t7GZSYUqOB65FsqaSRFmuYvBkP8hNNEpCKOR8UCFUjUVPHzpVQkuNpfQC5/wjOpal2I74yoPbA+xlmpQeIeSNibKHzfeHR8qQqOoG6OAbJD5nnK95//p2mqGBp50mMV4EfGtf2Q834Ngnv0/1zBNpVJ5QAmlH9vyi3eoQywW9Ox5+ROxS16BonVKMVDhRTiihuR5I+0sm9zwf+/iO8odGLO36oj0YUjV7yeb8pivxQTaFSiT+0yIvdzQUW/Fxi3qR9YsTU82xu6MgecAXrYWfE7p0+7vbBij7cQwxRhxlebTaedfkIh0/cwMlI/JXpmv/afCucnBjBOmXYCtHg+Gpj1SSzfhmqIyuR+zNruLocY+6VowVHj3KHlGGegWddIOJo0OKwx6nfV13n7HuCQrJxeqkH1RDFxCyxz1jN824YMc9/MT092maLi1nK9JJ63ZqFGQMta11VYg+O+LDU6XEfImijhP/aIgDGMOvhjafCY7cvKXQQ7WwZlxanV6Y4gzWfSCi1LdQsK2mCiVzz3GMzXuPRIqyttj6Gb99vFFmZkZDaFvsG980R9KeWkWjSFPRs/7bWdkMjIRGz9cknuRJbKHxSkoUSDMNNbcsSvEJS1nO75OUoh4RcuXXetotNaE9p05GyQlXlJXRmi1fTaisWRdEfw8r47o+Vu yPKsbqkt KCe7RmUX4kjUZTe/USc41dCC99qePelO1DfPeJdskgqcx9f4YLLkTxQU8gVqHUiTSh9snUoT8gxFqbv+10n9fRL2H9db1E59polvDBpcY7OlW7wvLlRsTk+HcMc0t1xtqFHIsxkOGWO8Ait2ad2JMaO8i6li56scTQ4rY81t+BFc+t6+jmAbOnaKBJg== 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: The function are defined in the list_lru.c file, but not called elsewhere, so delete the unused function. mm/list_lru.c:64:1: warning: unused function 'list_lru_from_kmem'. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6677 Signed-off-by: Jiapeng Chong --- mm/list_lru.c | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/mm/list_lru.c b/mm/list_lru.c index 37c5c2ef6c0e..800f171d2c23 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -60,27 +60,6 @@ list_lru_from_memcg_idx(struct list_lru *lru, int nid, int idx) return &lru->node[nid].lru; } -static inline struct list_lru_one * -list_lru_from_kmem(struct list_lru *lru, int nid, void *ptr, - struct mem_cgroup **memcg_ptr) -{ - struct list_lru_node *nlru = &lru->node[nid]; - struct list_lru_one *l = &nlru->lru; - struct mem_cgroup *memcg = NULL; - - if (!list_lru_memcg_aware(lru)) - goto out; - - memcg = mem_cgroup_from_slab_obj(ptr); - if (!memcg) - goto out; - - l = list_lru_from_memcg_idx(lru, nid, memcg_kmem_id(memcg)); -out: - if (memcg_ptr) - *memcg_ptr = memcg; - return l; -} #else static void list_lru_register(struct list_lru *lru) { @@ -105,15 +84,6 @@ list_lru_from_memcg_idx(struct list_lru *lru, int nid, int idx) { return &lru->node[nid].lru; } - -static inline struct list_lru_one * -list_lru_from_kmem(struct list_lru *lru, int nid, void *ptr, - struct mem_cgroup **memcg_ptr) -{ - if (memcg_ptr) - *memcg_ptr = NULL; - return &lru->node[nid].lru; -} #endif /* CONFIG_MEMCG_KMEM */ bool list_lru_add(struct list_lru *lru, struct list_head *item)