Thread (8 messages) 8 messages, 3 authors, 2021-08-28

Re: [PATCH v2 2/5] treewide: Replace open-coded flex arrays in unions

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: 2021-08-27 17:09:58
Also in: bpf, linux-can, linux-crypto, linux-hardening, linux-scsi, lkml, netdev

On 27.08.2021 09:08:19, Kees Cook wrote:
quoted
BTW: Is there opportunity for conversion, too?

| drivers/net/can/peak_canfd/peak_pciefd_main.c:146:32: warning: array of flexible structures
Oh, hrmpf. This isn't a sane use of flex arrays:

struct __packed pucan_rx_msg {
	...
	__le32	can_id;
	u8	d[];
};

struct pciefd_rx_dma {
        __le32 irq_status;
        __le32 sys_time_low;
        __le32 sys_time_high;
        struct pucan_rx_msg msg[];
} __packed __aligned(4);

I think that needs to be handled separately. How are you building to get
that warning, by the way? I haven't seen that in my builds...
If compiling with C=1, sparse will complain about this.

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help