lkml.org 
[lkml]   [2022]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 4/4] serial: Add kserial_rs485 to avoid wasted space due to .padding
From
On 30. 08. 22, 9:29, Ilpo Järvinen wrote:
> --- a/include/linux/serial_core.h
> +++ b/include/linux/serial_core.h
> @@ -31,6 +31,29 @@ struct serial_struct;
...
> + * Must match with struct serial_rs485 in include/uapi/linux/serial.h excluding
> + * the padding.

Have you considered BUILD_BUG_ON() checks with few offset_of()s to
enforce the above?

> +struct kserial_rs485 {
> + __u32 flags;
> + __u32 delay_rts_before_send;
> + __u32 delay_rts_after_send;
> + struct {
> + __u8 addr_recv;
> + __u8 addr_dest;
> + };
> +};

thanks,
--
js
suse labs

\
 
 \ /
  Last update: 2022-08-30 10:02    [W:0.970 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site