public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: "Frank Schäfer" <fschaefer.oss@googlemail.com>
To: mchehab@redhat.com
Cc: linux-media@vger.kernel.org,
	"Frank Schäfer" <fschaefer.oss@googlemail.com>
Subject: [PATCH 5/6] em28xx: em28xx_urb_data_copy_vbi(): calculate vbi_size only if needed
Date: Sun, 25 Nov 2012 11:37:36 +0100	[thread overview]
Message-ID: <1353839857-2990-6-git-send-email-fschaefer.oss@googlemail.com> (raw)
In-Reply-To: <1353839857-2990-1-git-send-email-fschaefer.oss@googlemail.com>

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
---
 drivers/media/usb/em28xx/em28xx-video.c |    5 ++---
 1 Datei geändert, 2 Zeilen hinzugefügt(+), 3 Zeilen entfernt(-)

diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
index 12e4b0a..6843784 100644
--- a/drivers/media/usb/em28xx/em28xx-video.c
+++ b/drivers/media/usb/em28xx/em28xx-video.c
@@ -525,7 +525,7 @@ static inline int em28xx_urb_data_copy_vbi(struct em28xx *dev, struct urb *urb)
 	struct em28xx_buffer    *buf, *vbi_buf;
 	struct em28xx_dmaqueue  *dma_q = &dev->vidq;
 	struct em28xx_dmaqueue  *vbi_dma_q = &dev->vbiq;
-	int xfer_bulk, vbi_size, num_packets, i, rc = 1;
+	int xfer_bulk, num_packets, i, rc = 1;
 	unsigned int actual_length, len = 0;
 	unsigned char *p, *outp = NULL, *vbioutp = NULL;
 
@@ -612,9 +612,8 @@ static inline int em28xx_urb_data_copy_vbi(struct em28xx *dev, struct urb *urb)
 		/* NOTE: with bulk transfers, intermediate data packets
 		 * have no continuation header */
 
-		vbi_size = dev->vbi_width * dev->vbi_height;
-
 		if (dev->capture_type == 0) {
+			int vbi_size = dev->vbi_width * dev->vbi_height;
 			if (dev->vbi_read >= vbi_size) {
 				/* We've already read all the VBI data, so
 				   treat the rest as video */
-- 
1.7.10.4


  parent reply	other threads:[~2012-11-25 10:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-25 10:37 [PATCH 0/6] em28xx: use common urb data copying function for vbi and non-vbi data streams Frank Schäfer
2012-11-25 10:37 ` [PATCH 1/6] em28xx: fix video data start position calculation in em28xx_urb_data_copy_vbi() Frank Schäfer
2012-11-25 10:37 ` [PATCH 2/6] em28xx: make sure the packet size is >= 4 before checking for headers " Frank Schäfer
2012-11-25 10:37 ` [PATCH 3/6] em28xx: fix capture type setting " Frank Schäfer
2012-11-25 10:37 ` [PATCH 4/6] em28xx: fix/improve frame field handling " Frank Schäfer
2012-11-25 10:37 ` Frank Schäfer [this message]
2012-11-25 10:37 ` [PATCH 6/6] em28xx: use common urb data copying function for vbi and non-vbi data streams Frank Schäfer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1353839857-2990-6-git-send-email-fschaefer.oss@googlemail.com \
    --to=fschaefer.oss@googlemail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox