[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230804041949.5724-1-rauji.raut@gmail.com>
Date: Thu, 3 Aug 2023 21:19:49 -0700
From: Atul Raut <rauji.raut@...il.com>
To: linux-kernel@...r.kernel.org
Cc: linux-kernel-mentees@...ts.linuxfoundation.org
Subject: [PATCH v2] ipc:msg: replace one-element array with flexible-array member
One-element arrays are obsolete, and flexible
array members have taken their place. So, in
struct compat_msgbuf, replace the one-element
array with a flexible-array member.
This fixes warnings such as:
./ipc/msg.c:981:6-11: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays)
Signed-off-by: Atul Raut <rauji.raut@...il.com>
---
ipc/msg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ipc/msg.c b/ipc/msg.c
index fd08b3cb36d7..ee6af4fe52bf 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -978,7 +978,7 @@ SYSCALL_DEFINE4(msgsnd, int, msqid, struct msgbuf __user *, msgp, size_t, msgsz,
struct compat_msgbuf {
compat_long_t mtype;
- char mtext[1];
+ char mtext[];
};
long compat_ksys_msgsnd(int msqid, compat_uptr_t msgp,
--
2.34.1
Powered by blists - more mailing lists