[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220304082333.9252-1-guozhengkui@vivo.com>
Date: Fri, 4 Mar 2022 16:23:32 +0800
From: Guo Zhengkui <guozhengkui@...o.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
Shuah Khan <shuah@...nel.org>,
linux-mm@...ck.org (open list:MEMORY MANAGEMENT),
linux-kselftest@...r.kernel.org (open list:KERNEL SELFTEST FRAMEWORK),
linux-kernel@...r.kernel.org (open list)
Cc: Guo Zhengkui <guozhengkui@...o.com>
Subject: [PATCH] userfaultfd/selftests: fix uninitialized_var.cocci warning
fix following coccicheck warning:
tools/testing/selftests/vm/userfaultfd.c:556:23-24:
WARNING this kind of initialization is deprecated
`unsigned long page_nr = *(&page_nr)` has the same form of
uninitialized_var() macro. I remove the redundant assignement. It has
been tested with gcc (Debian 8.3.0-6) 8.3.0.
The patch which removed uninitialized_var() is:
https://lore.kernel.org/all/20121028102007.GA7547@gmail.com/
And there is very few "/* GCC */" comments in the Linux kernel code now.
Signed-off-by: Guo Zhengkui <guozhengkui@...o.com>
---
tools/testing/selftests/vm/userfaultfd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c
index fe404398c65a..203c4a2c2109 100644
--- a/tools/testing/selftests/vm/userfaultfd.c
+++ b/tools/testing/selftests/vm/userfaultfd.c
@@ -553,7 +553,7 @@ static void continue_range(int ufd, __u64 start, __u64 len)
static void *locking_thread(void *arg)
{
unsigned long cpu = (unsigned long) arg;
- unsigned long page_nr = *(&(page_nr)); /* uninitialized warning */
+ unsigned long page_nr;
unsigned long long count;
if (!(bounces & BOUNCE_RANDOM)) {
--
2.20.1
Powered by blists - more mailing lists