From patchwork Tue Aug 27 01:57:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongbo Li X-Patchwork-Id: 13778705 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 DED13C5321D for ; Tue, 27 Aug 2024 01:49:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5C0136B008C; Mon, 26 Aug 2024 21:49:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 56FD26B0092; Mon, 26 Aug 2024 21:49:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 45E326B0095; Mon, 26 Aug 2024 21:49:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 2E5976B008C for ; Mon, 26 Aug 2024 21:49:36 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id CC8CC1C576E for ; Tue, 27 Aug 2024 01:49:35 +0000 (UTC) X-FDA: 82496343510.09.4430074 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf25.hostedemail.com (Postfix) with ESMTP id 14608A0008 for ; Tue, 27 Aug 2024 01:49:32 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=none; spf=pass (imf25.hostedemail.com: domain of lihongbo22@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=lihongbo22@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724723331; 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-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=3B8OtMS5qmE1PciQPW79WnQySctGabDs6IEGp1Otvd4=; b=7fYNtziV46BLjij27nYiwMt+u9lPbaSr6pFgqx9UTa5Udijd9KA3gGqfGY2QXxUzDXmQsF tgxAD5SFAl+7viJXkzEXAj2FequVm2E/tVOo8Gh+zRXWjHjGOd4RoKiGUy2iMqKwhUVgYp gbgSYk0VvBHg0pp8BmXjmpsstymb9X8= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=none; spf=pass (imf25.hostedemail.com: domain of lihongbo22@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=lihongbo22@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724723331; a=rsa-sha256; cv=none; b=2GVo4JhVd0uTMv+FzDELZXmEZs1MhqeTxP8TRf2FrbgcsoJFiLeLck165sRcpABjRYN7IQ ApSmUZuLujn2qkSJT112+DG8/Iv4WSAageZR87xO99qfJwDwtvZYQkQ1IHSitTL71mc5m7 kkN2FixHaA+vjCoaPl2XXcwusMX9w/A= Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Wt9SX1nYBzyRDT; Tue, 27 Aug 2024 09:49:00 +0800 (CST) Received: from dggpeml500022.china.huawei.com (unknown [7.185.36.66]) by mail.maildlp.com (Postfix) with ESMTPS id 15AF9140257; Tue, 27 Aug 2024 09:49:29 +0800 (CST) Received: from huawei.com (10.90.53.73) by dggpeml500022.china.huawei.com (7.185.36.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 27 Aug 2024 09:49:28 +0800 From: Hongbo Li To: , , CC: , Subject: [PATCH -next] mm: make use of the helper macro LIST_HEAD() Date: Tue, 27 Aug 2024 09:57:24 +0800 Message-ID: <20240827015724.620110-1-lihongbo22@huawei.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.90.53.73] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500022.china.huawei.com (7.185.36.66) X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 14608A0008 X-Stat-Signature: kar6jdzk16wsea6hrizxzoto98iarixn X-HE-Tag: 1724723372-467387 X-HE-Meta: U2FsdGVkX1+W4vt3pbt+ZcfomTTi8tMHd7VMJYbfU47ttrSd6oLI8D7uIIrvKIIs567S6bzmGGOWWqdhekHLhx0YpqkZGIvzSlVFyNwddlDDwtZmHLfxSd9OaUSYSPddMU+IQIoz0ToifkGuKluduQRX7pEOz6+94RzAz3NoXJnqQU3Fnk0sW25tucLFEo1ekL143Y8dJujsBcCM1vi8fLNesHDVvqbW/766VT1FPuul1bioFTk/1qKVhPHc5Z6Zxx4BXE0wMxzAhnCIDNRnBA3WpQPKEkwLqNeXY2I4R+qC75wtz/irD4h51gkP8B9sx3qOKXA9SdrR94kdpzmnu1vcn3KkggasZMUWZl1dKqZzCC6rBvoYRNqZLeGKEL8R5KwjdGKvZW+gxKamOSmuxC8phAC0gX3Ny9FDzmn3QNs+qK6nahff68mQwpcFxE9R7wkgdtjp3yKroPWW7eFDQq3Rp2W34AVtIMKCX//3XhWXy9oa+/97x6nm6ZfBMJ6bT/R6TmhiMS9RCOF+HtebfrONND5Zc3P9Ne+zxq8FQpuGRcSboa0Xoy70sjeHkob4JtsFCPGn5yZv14wj0DMVofslj+K5C5+o0o2BRXKo81uXrte7nxmkzCqk3ZnLYgqMXGaDLi3dp/8r9SrQ5uxxQYBuAQpQzfeSU7f6LWrlcbfV6ha85ApI0kxHcuIzTnkumB5Bcy+1VdTJsNhR9A2cpEgl+pcNHjCOvbaHwImYHMr4XDpv6e0zv4ANBAF4MgWWD86onfv1NgOExfNyBWiY1lWLfugNdkZpO1npvUWOOet4C2aqbBcW8MSJOKYXWTraHYRWpLpBPcuXMSznk9mHztFNXKsJbOXDby3URurz+imJZ9rSHQRYtXRrgEgsc7IIPrEiYkwhBKa1jr9FgVjZi4j2RG4q1OjbkyjG5irnH2gqddxFPb2Hj59VzwTIKYCyM+3xEbW75e08LWxfjkR tLaCLKJR TzYcYpvvN2u7GeyEt1TA+6y/rKgNMgARhpPGe5A7Z7h2ri1RriY9Yx5iON15sUSHAvidbWXtlmAiMdzqj0gud1lYzQnnuyHETTBSz3SdvD66V3CwkViGHuPtTEG7W9ggwRbybVBEa/fzcTLY8sXJUyz3oEOhhVzBhOyEpifCbE11kXt0M08YOXb3sck8kPRL1EMoqItqmpX8Wdr3gzuhpEk0FPVHAGARBZeISYa0BFlKlqDMyrv4yjI1vPg== 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: List-Subscribe: List-Unsubscribe: list_head can be initialized automatically with LIST_HEAD() instead of calling INIT_LIST_HEAD(). Here we can simplify the code. Signed-off-by: Hongbo Li --- mm/vmalloc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 3f9b6bd707d2..3f7b38481fcc 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -2141,13 +2141,11 @@ decay_va_pool_node(struct vmap_node *vn, bool full_decay) INIT_LIST_HEAD(&decay_list); for (i = 0; i < MAX_VA_SIZE_PAGES; i++) { - struct list_head tmp_list; + LIST_HEAD(tmp_list); if (list_empty(&vn->pool[i].head)) continue; - INIT_LIST_HEAD(&tmp_list); - /* Detach the pool, so no-one can access it. */ spin_lock(&vn->pool_lock); list_replace_init(&vn->pool[i].head, &tmp_list);