On Tue, Jul 06, 2021 at 03:28:34PM +0200, David Jander wrote: > On Tue, 6 Jul 2021 13:57:58 +0200 > Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> wrote: > > > -static size_t j1939_sk_opt_stats_get_size(void) > > +static size_t j1939_sk_opt_stats_get_size(enum j1939_sk_errqueue_type type) > > { > > - return > > - nla_total_size(sizeof(u32)) + /* J1939_NLA_BYTES_ACKED */ > > - 0; > > + switch (type) { > > + case J1939_ERRQUEUE_RX_RTS: > > + return > > + nla_total_size(sizeof(u32)) + /* J1939_NLA_BYTES_ALL */ > > + nla_total_size(sizeof(u64)) + /* J1939_NLA_DEST_ADDR */ > > + nla_total_size(sizeof(u64)) + /* J1939_NLA_SRC_ADDR */ > > DST and SRC address are u8...? done > > + nla_total_size(sizeof(u64)) + /* J1939_NLA_DEST_NAME */ > > + nla_total_size(sizeof(u64)) + /* J1939_NLA_SRC_NAME */ > > + nla_put_u8(stats, J1939_NLA_SRC_ADDR, > > + session->skcb.addr.sa); > > + nla_put_u8(stats, J1939_NLA_DEST_ADDR, > > + session->skcb.addr.da); > > See above. > Also, shouldn't the order of these be the same as in > j1939_sk_opt_stats_get_size()... for readability? ack, done Regards, Oleksij -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |