Re: dw2102.c: quadratic increment intended?

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

 



On Sun, 2011-02-27 at 20:30 +0200, Igor M. Liplianin wrote:
> Ð ÑÐÐÐÑÐÐÐÐ ÐÑ 27 ÑÐÐÑÐÐÑ 2011 16:40:19 ÐÐÑÐÑ TÃrÃk Edwin ÐÐÐÐÑÐÐ:
> > Hi,
> Hi
> 
> > 
> > Please see http://llvm.org/bugs/show_bug.cgi?id=9259#c5, is the code
> > intended to do a quadratic increment there?
> > 
> > While looking at this, I wonder if this isn't also a bug in the original
> > code:
> > 
> >         /* read stv0299 register */
> >         request = 0xb5;
> >         value = msg[0].buf[0];/* register */
> >         for (i = 0; i < msg[1].len; i++) {
> >             value = value + i;
> >             ret = dw2102_op_rw(d->udev, 0xb5,
> >                 value, buf6, 2, DW2102_READ_MSG);
> >             msg[1].buf[i] = buf6[0];
> > 
> >         }
> > 
> > I don't know anything about the hardware this driver is written for, but is
> > 'value' really intended to increment quadratically? That seems
> > suspicious. One
> > wonders if the following is what was intended:
> > 
> >         [...]
> >         for (i = 0; i < msg[1].len; i++) {
> >             ret = dw2102_op_rw(d->udev, 0xb5,
> >                 value + i, buf6, 2, DW2102_READ_MSG);
> >             msg[1].buf[i] = buf6[0];
> > 
> >         }
> > 
> Accidentally, this didn't affect driver, as it reads registers by one register at one time.
> But it should be corrected.

stv0299, along with other stv02xx family members can read and write the
entire register map from the start register.

However, there is a limitation, the buffer size of the I2C master
hardware.


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux