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