From: Xiu Jianfeng <xiujianfeng@huawei.com>
To: <akpm@linux-foundation.org>
Cc: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH -next] secretmem: use ATOMIC_INIT() to initialize secretmem_users
Date: Tue, 6 Sep 2022 17:36:20 +0800 [thread overview]
Message-ID: <20220906093620.243465-1-xiujianfeng@huawei.com> (raw)
The variable secretmem_users is of atomic_t type, so initialize it
properly with ATOMIC_INIT().
Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
---
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)
{
--
2.17.1
next reply other threads:[~2022-09-06 9:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-06 9:36 Xiu Jianfeng [this message]
2022-09-07 5:58 ` Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220906093620.243465-1-xiujianfeng@huawei.com \
--to=xiujianfeng@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®