[PATCH v2 2/5] treewide: Replace open-coded flex arrays in unions
Marc Kleine-Budde
mkl at pengutronix.de
Fri Aug 27 10:08:37 PDT 2021
On 27.08.2021 09:08:19, Kees Cook wrote:
> > 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 |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/ath10k/attachments/20210827/f26f9994/attachment.sig>
More information about the ath10k
mailing list