lkml.org 
[lkml]   [2021]   [Aug]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/5] treewide: Replace open-coded flex arrays in unions
On Wed, Aug 18, 2021 at 11:56:35AM +0200, Marc Kleine-Budde wrote:
> On 18.08.2021 01:11:15, Kees Cook wrote:
> > diff --git a/drivers/net/can/usb/etas_es58x/es581_4.h b/drivers/net/can/usb/etas_es58x/es581_4.h
> > index 4bc60a6df697..8657145dc2a9 100644
> > --- a/drivers/net/can/usb/etas_es58x/es581_4.h
> > +++ b/drivers/net/can/usb/etas_es58x/es581_4.h
> > @@ -192,7 +192,7 @@ struct es581_4_urb_cmd {
> > struct es581_4_rx_cmd_ret rx_cmd_ret;
> > __le64 timestamp;
> > u8 rx_cmd_ret_u8;
> > - u8 raw_msg[0];
> > + flex_array(u8 raw_msg);
> > } __packed;
> >
> > __le16 reserved_for_crc16_do_not_use;
> > diff --git a/drivers/net/can/usb/etas_es58x/es58x_fd.h b/drivers/net/can/usb/etas_es58x/es58x_fd.h
> > index ee18a87e40c0..3053e0958132 100644
> > --- a/drivers/net/can/usb/etas_es58x/es58x_fd.h
> > +++ b/drivers/net/can/usb/etas_es58x/es58x_fd.h
> > @@ -228,7 +228,7 @@ struct es58x_fd_urb_cmd {
> > struct es58x_fd_tx_ack_msg tx_ack_msg;
> > __le64 timestamp;
> > __le32 rx_cmd_ret_le32;
> > - u8 raw_msg[0];
> > + flex_array(u8 raw_msg[]);
> > } __packed;
>
> This doesn't look consistent, what's preferred?
>
> u8 raw_msg[0]; -> flex_array(u8 raw_msg);
> - or-
> -> flex_array(u8 raw_msg[]);

Eek, thanks for catching that. And this helps me realize that having
"flex_array" and "[]" is redundant, and the above typo would have been
caught. I will fix this for v2.

Thanks!

-Kees

--
Kees Cook

\
 
 \ /
  Last update: 2021-08-18 23:52    [W:0.075 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site