V4L/DVB (10367): gspca - spca561: Optimize the isoc scanning function.
authorJean-Francois Moine <moinejf@free.fr>
Fri, 16 Jan 2009 11:57:28 +0000 (08:57 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 30 Mar 2009 15:42:32 +0000 (12:42 -0300)
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/gspca/spca561.c

index 173c0c43fd1f69dfabf0dd1c8084d4115565add7..386aaec3e6e1aa3a08e4df1a529382a8b0d60daf 100644 (file)
@@ -141,7 +141,6 @@ static const struct v4l2_pix_format sif_072a_mode[] = {
 #define SPCA561_OFFSET_WIN1GBAVE 14
 #define SPCA561_OFFSET_FREQ 15
 #define SPCA561_OFFSET_VSYNC 16
-#define SPCA561_OFFSET_DATA 1
 #define SPCA561_INDEX_I2C_BASE 0x8800
 #define SPCA561_SNAPBIT 0x20
 #define SPCA561_SNAPCTRL 0x40
@@ -866,12 +865,11 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
 {
        struct sd *sd = (struct sd *) gspca_dev;
 
-       switch (data[0]) {                      /* sequence number */
+       len--;
+       switch (*data++) {                      /* sequence number */
        case 0:                                 /* start of frame */
                frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
                                        data, 0);
-               data += SPCA561_OFFSET_DATA;
-               len -= SPCA561_OFFSET_DATA;
                if (data[1] & 0x10) {
                        /* compressed bayer */
                        gspca_frame_add(gspca_dev, FIRST_PACKET,
@@ -892,8 +890,6 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
        case 0xff:                      /* drop (empty mpackets) */
                return;
        }
-       data++;
-       len--;
        gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
 }