Re: [PATCH] ksmbd: fix flexible_array.cocci warnings

From: Sergey Senozhatsky
Date: Wed Nov 03 2021 - 20:11:24 EST


On (21/11/03 22:51), Namjae Jeon wrote:
>
> 2021-11-03 22:19 GMT+09:00, Guo Zhengkui <guozhengkui@xxxxxxxx>:
> > Fix following coccicheck warning:
> > ./fs/ksmbd/transport_rdma.c:201:20-27: WARNING use flexible-array
> > member instead.
> Is there only one here? It would be better to change them together in
> this patch.

I guess I see more than one

fs/ksmbd/ksmbd_netlink.h: __u8 spnego_blob[0]; /*
fs/ksmbd/ntlmssp.h: __u8 Content[0];
fs/ksmbd/ntlmssp.h: char DomainString[0];
fs/ksmbd/ntlmssp.h: char UserString[0];
fs/ksmbd/smb2pdu.h: __u8 Buffer[0];
fs/ksmbd/smb2pdu.h: __u8 Buffer[0];
fs/ksmbd/smb2pdu.h: char FileName[0]; /* New name to be assigned */
fs/ksmbd/smb2pdu.h: char FileName[0]; /* Name to be assigned to new link */
fs/ksmbd/smb2pdu.h: char FileName[0];
fs/ksmbd/smb2pdu.h: char StreamName[0];
fs/ksmbd/transport_rdma.c: struct scatterlist sg_list[0];