summaryrefslogtreecommitdiff
path: root/drivers/media/video/pvrusb2
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2009-11-25 02:59:34 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 18:42:10 -0200
commit9081d9018581e01eec9085a80c86bc07e7168f18 (patch)
tree09ea66e1aeac344079d363afb06a0536a27006f7 /drivers/media/video/pvrusb2
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/media/video/pvrusb2')
-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)
const struct firmware *fw_entry = NULL;
void *fw_ptr;
unsigned int pipe;
+ unsigned int fwsize;
int ret;
u16 address;
@@ -1473,19 +1474,20 @@ static int pvr2_upload_firmware1(struct pvr2_hdw *hdw)
usb_clear_halt(hdw->usb_dev, usb_sndbulkpipe(hdw->usb_dev, 0 & 0x7f));
pipe = usb_sndctrlpipe(hdw->usb_dev, 0);
+ fwsize = fw_entry->size;
- if ((fw_entry->size != 0x2000) &&
- (!(hdw->hdw_desc->flag_fx2_16kb && (fw_entry->size == 0x4000)))) {
+ if ((fwsize != 0x2000) &&
+ (!(hdw->hdw_desc->flag_fx2_16kb && (fwsize == 0x4000)))) {
if (hdw->hdw_desc->flag_fx2_16kb) {
pvr2_trace(PVR2_TRACE_ERROR_LEGS,
"Wrong fx2 firmware size"
" (expected 8192 or 16384, got %u)",
- fw_entry->size);
+ fwsize);
} else {
pvr2_trace(PVR2_TRACE_ERROR_LEGS,
"Wrong fx2 firmware size"
" (expected 8192, got %u)",
- fw_entry->size);
+ fwsize);
}
release_firmware(fw_entry);
return -ENOMEM;
@@ -1504,7 +1506,7 @@ static int pvr2_upload_firmware1(struct pvr2_hdw *hdw)
chunk. */
ret = 0;
- for(address = 0; address < fw_entry->size; address += 0x800) {
+ for (address = 0; address < fwsize; address += 0x800) {
memcpy(fw_ptr, fw_entry->data + address, 0x800);
ret += usb_control_msg(hdw->usb_dev, pipe, 0xa0, 0x40, address,
0, fw_ptr, 0x800, HZ);