[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220114064625.765511-1-deng.changcheng@zte.com.cn>
Date: Fri, 14 Jan 2022 06:46:25 +0000
From: cgel.zte@...il.com
To: sfrench@...ba.org
Cc: linux-cifs@...r.kernel.org, samba-technical@...ts.samba.org,
linux-kernel@...r.kernel.org,
Changcheng Deng <deng.changcheng@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: [PATCH] cifs: Replace one-element array with flexible-array member
From: Changcheng Deng <deng.changcheng@....com.cn>
There is a regular need in the kernel to provide a way to declare having
a dynamically sized set of trailing elements in a structure. Kernel code
should always use "flexible array members" for these cases. The older
style of one-element or zero-length arrays should no longer be used.
Reference:
https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Changcheng Deng <deng.changcheng@....com.cn>
---
fs/cifs/smb2ops.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index af5d0830bc8a..5c104b2f308a 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -1609,10 +1609,10 @@ struct iqi_vars {
struct smb_rqst rqst[3];
struct kvec rsp_iov[3];
struct kvec open_iov[SMB2_CREATE_IOV_SIZE];
- struct kvec qi_iov[1];
+ struct kvec qi_iov[];
struct kvec io_iov[SMB2_IOCTL_IOV_SIZE];
struct kvec si_iov[SMB2_SET_INFO_IOV_SIZE];
- struct kvec close_iov[1];
+ struct kvec close_iov[];
};
static int
--
2.25.1
Powered by blists - more mailing lists