linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/3] pac7311: remove magic value for USB_BUF_SZ
@ 2009-10-03  7:35 Németh Márton
  0 siblings, 0 replies; only message in thread
From: Németh Márton @ 2009-10-03  7:35 UTC (permalink / raw)
  To: Jean-Francois Moine, Thomas Kaiser; +Cc: V4L Mailing List, LKML

From: Márton Németh <nm127@freemail.hu>

The length check in reg_w_var() function is because the buffer contents
is copied to gspca_dev->usb_buf which has the size of USB_BUF_SZ bytes as
defined in drivers/media/video/gspca/gspca.h. Replace the number with
symbol for better readability and maintainability.

The change was tested with Labtec Webcam 2200.

Signed-off-by: Márton Németh <nm127@freemail.hu>
---
diff -upr c/drivers/media/video/gspca/pac7311.c d/drivers/media/video/gspca/pac7311.c
--- c/drivers/media/video/gspca/pac7311.c	2009-10-03 08:47:30.000000000 +0200
+++ d/drivers/media/video/gspca/pac7311.c	2009-10-03 09:02:31.000000000 +0200
@@ -474,7 +474,7 @@ static void reg_w_var(struct gspca_dev *
 			reg_w_page(gspca_dev, page3_7302, sizeof page3_7302);
 			break;
 		default:
-			if (len > 64) {
+			if (len > USB_BUF_SZ) {
 				PDEBUG(D_ERR|D_STREAM,
 					"Incorrect variable sequence");
 				return;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-10-03  7:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-03  7:35 [PATCH 3/3] pac7311: remove magic value for USB_BUF_SZ Németh Márton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).