aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2009-11-25 00:59:34 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 15:42:10 -0500
commit9081d9018581e01eec9085a80c86bc07e7168f18 (patch)
tree09ea66e1aeac344079d363afb06a0536a27006f7 /drivers
parent4b1c83cc51381c3d523452353204247398f5116c (diff)
V4L/DVB (13499): pvrusb2: Cosmetic tweak to minimize size_t exposure
Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index bd05ec7b1cbe..e93f3e2c25e7 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -1447,6 +1447,7 @@ static int pvr2_upload_firmware1(struct pvr2_hdw *hdw)
1447 const struct firmware *fw_entry = NULL; 1447 const struct firmware *fw_entry = NULL;
1448 void *fw_ptr; 1448 void *fw_ptr;
1449 unsigned int pipe; 1449 unsigned int pipe;
1450 unsigned int fwsize;
1450 int ret; 1451 int ret;
1451 u16 address; 1452 u16 address;
1452 1453
@@ -1473,19 +1474,20 @@ static int pvr2_upload_firmware1(struct pvr2_hdw *hdw)
1473 usb_clear_halt(hdw->usb_dev, usb_sndbulkpipe(hdw->usb_dev, 0 & 0x7f)); 1474 usb_clear_halt(hdw->usb_dev, usb_sndbulkpipe(hdw->usb_dev, 0 & 0x7f));
1474 1475
1475 pipe = usb_sndctrlpipe(hdw->usb_dev, 0); 1476 pipe = usb_sndctrlpipe(hdw->usb_dev, 0);
1477 fwsize = fw_entry->size;
1476 1478
1477 if ((fw_entry->size != 0x2000) && 1479 if ((fwsize != 0x2000) &&
1478 (!(hdw->hdw_desc->flag_fx2_16kb && (fw_entry->size == 0x4000)))) { 1480 (!(hdw->hdw_desc->flag_fx2_16kb && (fwsize == 0x4000)))) {
1479 if (hdw->hdw_desc->flag_fx2_16kb) { 1481 if (hdw->hdw_desc->flag_fx2_16kb) {
1480 pvr2_trace(PVR2_TRACE_ERROR_LEGS, 1482 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
1481 "Wrong fx2 firmware size" 1483 "Wrong fx2 firmware size"
1482 " (expected 8192 or 16384, got %u)", 1484 " (expected 8192 or 16384, got %u)",
1483 fw_entry->size); 1485 fwsize);
1484 } else { 1486 } else {
1485 pvr2_trace(PVR2_TRACE_ERROR_LEGS, 1487 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
1486 "Wrong fx2 firmware size" 1488 "Wrong fx2 firmware size"
1487 " (expected 8192, got %u)", 1489 " (expected 8192, got %u)",
1488 fw_entry->size); 1490 fwsize);
1489 } 1491 }
1490 release_firmware(fw_entry); 1492 release_firmware(fw_entry);
1491 return -ENOMEM; 1493 return -ENOMEM;
@@ -1504,7 +1506,7 @@ static int pvr2_upload_firmware1(struct pvr2_hdw *hdw)
1504 chunk. */ 1506 chunk. */
1505 1507
1506 ret = 0; 1508 ret = 0;
1507 for(address = 0; address < fw_entry->size; address += 0x800) { 1509 for (address = 0; address < fwsize; address += 0x800) {
1508 memcpy(fw_ptr, fw_entry->data + address, 0x800); 1510 memcpy(fw_ptr, fw_entry->data + address, 0x800);
1509 ret += usb_control_msg(hdw->usb_dev, pipe, 0xa0, 0x40, address, 1511 ret += usb_control_msg(hdw->usb_dev, pipe, 0xa0, 0x40, address,
1510 0, fw_ptr, 0x800, HZ); 1512 0, fw_ptr, 0x800, HZ);