Re: [PATCH v3 13/13] can: slcan: extend the protocol with CAN state info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 14.06.2022 08:29:57, Dario Binacchi wrote:
> > > +     cmd[SLC_STATE_BE_TXCNT_LEN] = 0;
> > > +     if (kstrtou32(cmd, 10, &txerr))
> > > +             return;
> > > +
> > > +     *cmd = 0;
> > > +     cmd -= SLC_STATE_BE_RXCNT_LEN;
> > > +     if (kstrtou32(cmd, 10, &rxerr))
> > > +             return;
> >
> > Why do you parse TX first and then RX?
> 
> Since adding the end-of-string character to the counter to be decoded
> invalidates the next one.
> If I had started from the rx counter, I would have found the
> transmission counter always at 0.

Thanks for the explanation.

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 |

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux