Re: [PATCH v6] can, tty: can327 CAN/ldisc driver for ELM327 based OBD-II adapters

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

 



On Fri. 13 May 2022 at 11:38, Vincent Mailhol <vincent.mailhol@xxxxxxxxx> wrote:
[...]
> > +       case ELM327_STATE_RECEIVING:
> > +               /* Find <CR> delimiting feedback lines. */
> > +               for (len = 0;
> > +                    (len < elm->rxfill) && (elm->rxbuf[len] != '\r');
> > +                    len++) {
> > +                       /* empty loop */
>
> Question of taste but would prefer a while look with the len++ in the
> body (if you prefer to do as above, no need to argue, just keep it
> like it is).

Actually, what about this?

len = strnchr(elm->rxbuf, elm->rxfill, '\r');



[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