public inbox for linux-can@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: David Jander <david@protonic.nl>
Cc: dev.kurt@vandijck-laurijssen.be, mkl@pengutronix.de,
	wg@grandegger.com, kernel@pengutronix.de,
	linux-can@vger.kernel.org, netdev@vger.kernel.org,
	Zhang Changzhong <zhangchangzhong@huawei.com>
Subject: Re: [PATCH v1 2/2] net: j1939: extend UAPI to notify about RX status
Date: Wed, 7 Jul 2021 11:41:50 +0200	[thread overview]
Message-ID: <20210707094150.rbccshvdp67fknbe@pengutronix.de> (raw)
In-Reply-To: <20210706152834.44e62837@erd992>

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@pengutronix.de> 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 |

      reply	other threads:[~2021-07-07  9:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-06 11:57 [PATCH v1 1/2] net: j1939: rename J1939_ERRQUEUE_* to J1939_ERRQUEUE_TX_* Oleksij Rempel
2021-07-06 11:57 ` [PATCH v1 2/2] net: j1939: extend UAPI to notify about RX status Oleksij Rempel
2021-07-06 13:28   ` David Jander
2021-07-07  9:41     ` Oleksij Rempel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210707094150.rbccshvdp67fknbe@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=david@protonic.nl \
    --cc=dev.kurt@vandijck-laurijssen.be \
    --cc=kernel@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=wg@grandegger.com \
    --cc=zhangchangzhong@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox