> > - if (priv->pos + 1 >= msg->len)
> > - rcar_i2c_write(priv, ICMCR, RCAR_BUS_PHASE_STOP);
> > + /* If next received data is the _LAST_, go to new phase. */
> > + if (priv->pos + 1 == msg->len) {
> > + if (priv->flags & ID_LAST_MSG) {
> > + rcar_i2c_write(priv, ICMCR, RCAR_BUS_PHASE_STOP);
> > + } else {
> > + rcar_i2c_write(priv, ICMCR, RCAR_BUS_PHASE_START);
> > + priv->flags |= ID_P_REP_AFTER_RD;
> > + }
> > + }
>
> So "priv->pos + 1 <= msg->len" is an invariant? (The current code seems to
> imply that it isn't.)I think it is, we increment pos by 1 right before this 'if'. Do you agree? IIRC the old '>=' came from a 'well, won't hurt' attitude. It was not precise, sadly. > If it is, > Reviewed-by: Ulrich Hecht <[email protected]> Thanks.
signature.asc
Description: PGP signature
