Hi,

On 6 January 2012 17:55, Stefan Hajnoczi <stefa...@gmail.com> wrote:
> Is the following code correct in hw/omap_dss.c:
>
> case 0x58:  /* RFBI_READ */
>    if ((s->rfbi.control & (1 << 2)) && s->rfbi.chip[0])
>        s->rfbi.rxbuf = s->rfbi.chip[0]->read(s->rfbi.chip[0]->opaque, 1);
>    else if ((s->rfbi.control & (1 << 3)) && s->rfbi.chip[1])
>        s->rfbi.rxbuf = s->rfbi.chip[0]->read(s->rfbi.chip[0]->opaque, 1);
>    if (!-- s->rfbi.pixels)
>        omap_rfbi_transfer_stop(s);
>    break;
>
> case 0x5c:  /* RFBI_STATUS */
>    if ((s->rfbi.control & (1 << 2)) && s->rfbi.chip[0])
>        s->rfbi.rxbuf = s->rfbi.chip[0]->read(s->rfbi.chip[0]->opaque, 0);
>    else if ((s->rfbi.control & (1 << 3)) && s->rfbi.chip[1])
>        s->rfbi.rxbuf = s->rfbi.chip[0]->read(s->rfbi.chip[0]->opaque, 0);
>    if (!-- s->rfbi.pixels)
>        omap_rfbi_transfer_stop(s);
>    break;
>
> It checks chip[1] in the "else if" statement.  But notice it actually
> operates on chip[0].
>
> Is this intentional or should it use chip[1]?

Right, it should use chip[1], it's a bug.  If a machine only had a
rfbi chip attached at 1, it might even cause a segfault, but the N900
uses only rfbi 0.

Cheers

Reply via email to