linux-stable/include/linux/mailbox/zynqmp-ipi-message.h
Gustavo A. R. Silva 277ffd6c1e mailbox: zynqmp-ipi-message: Replace zero-length array with flexible-array member
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”[1] for these cases. The older style of
one-element or zero-length arrays should no longer be used[2].

[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.9-rc1/process/deprecated.html#zero-length-and-one-element-arrays

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
2020-10-29 17:22:59 -05:00

20 lines
501 B
C

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_ZYNQMP_IPI_MESSAGE_H_
#define _LINUX_ZYNQMP_IPI_MESSAGE_H_
/**
* struct zynqmp_ipi_message - ZynqMP IPI message structure
* @len: Length of message
* @data: message payload
*
* This is the structure for data used in mbox_send_message
* the maximum length of data buffer is fixed to 12 bytes.
* Client is supposed to be aware of this.
*/
struct zynqmp_ipi_message {
size_t len;
u8 data[];
};
#endif /* _LINUX_ZYNQMP_IPI_MESSAGE_H_ */