From patchwork Tue Sep 6 09:36:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiu Jianfeng X-Patchwork-Id: 12967179 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 CB06CECAAA1 for ; Tue, 6 Sep 2022 09:39:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4FF4C80272; Tue, 6 Sep 2022 05:39:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4AE3F80224; Tue, 6 Sep 2022 05:39:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 39DA780272; Tue, 6 Sep 2022 05:39:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 29AB380224 for ; Tue, 6 Sep 2022 05:39:48 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id F201BC0E8C for ; Tue, 6 Sep 2022 09:39:47 +0000 (UTC) X-FDA: 79881163614.11.F1767B1 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf10.hostedemail.com (Postfix) with ESMTP id 75C6CC0065 for ; Tue, 6 Sep 2022 09:39:47 +0000 (UTC) Received: from dggpeml500023.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MMKy522wszkWvk; Tue, 6 Sep 2022 17:35:57 +0800 (CST) Received: from ubuntu1804.huawei.com (10.67.174.58) by dggpeml500023.china.huawei.com (7.185.36.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 6 Sep 2022 17:39:44 +0800 From: Xiu Jianfeng To: CC: , Subject: [PATCH -next] secretmem: use ATOMIC_INIT() to initialize secretmem_users Date: Tue, 6 Sep 2022 17:36:20 +0800 Message-ID: <20220906093620.243465-1-xiujianfeng@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.67.174.58] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpeml500023.china.huawei.com (7.185.36.114) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662457187; a=rsa-sha256; cv=none; b=IaETVCzZ5GTgglCsr/fjZ3whe6D0Kt9sb2iu1wZmzTlVkodiZQpZwO9JB/l2irXROgqxSC hD05FPNSVeQlPehxKTUvaO+fFIJTo0ENguDem6iNHx+jYtejYhKRxO6ZzFGeSkedPC92iw So8OfI9nTTZjmuNe9CqV4YKh7epOFT8= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of xiujianfeng@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=xiujianfeng@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=1662457187; 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:in-reply-to: references; bh=6SbJlxZUSQWuP+0gM11z6vbHvqH4cPxXqUeoEgGbHLc=; b=lVQ70/1eCAyYdxRJ+XgkPzcKSe8C8NysUgoFK0pyqTuSUYrsl5fJQaPVsGd5x6nsErYLKm BBuvNwwyT3MEIBLlp+dE2xPj4jynvieFHLrJPzbK+ZHV2bHxtOUeygR1qedygb2lkmU5Jl VJcxgP0OG0ByCiWpYZGTduljEGV/Uas= X-Stat-Signature: hwqhpr6w9yqgjkegpqchuindadx551qm X-Rspamd-Queue-Id: 75C6CC0065 X-Rspamd-Server: rspam07 X-Rspam-User: Authentication-Results: imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of xiujianfeng@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=xiujianfeng@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-HE-Tag: 1662457187-167428 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 variable secretmem_users is of atomic_t type, so initialize it properly with ATOMIC_INIT(). Signed-off-by: Xiu Jianfeng --- mm/secretmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/secretmem.c b/mm/secretmem.c index e3e9590c6fb3..796d3a92992a 100644 --- a/mm/secretmem.c +++ b/mm/secretmem.c @@ -40,7 +40,7 @@ module_param_named(enable, secretmem_enable, bool, 0400); MODULE_PARM_DESC(secretmem_enable, "Enable secretmem and memfd_secret(2) system call"); -static atomic_t secretmem_users; +static atomic_t secretmem_users = ATOMIC_INIT(0); bool secretmem_active(void) {