Skip to content

Commit 63c5f1d

Browse files
Jinjie RuanHans Verkuil
authored andcommitted
media: cx231xx: Use EP5_BUF_SIZE macro
As Andrzej suggested, use EP5_BUF_SIZE macro to replace the other three places of 4096 in cx231xx with EP5_BUF_SIZE. Signed-off-by: Jinjie Ruan <[email protected]> Suggested-by: Andrzej Pietrasiewicz <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent 8cd08e3 commit 63c5f1d

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

drivers/media/usb/cx231xx/cx231xx-417.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,6 @@ static int cx231xx_load_firmware(struct cx231xx *dev)
937937
u32 *p_current_fw, *p_fw;
938938
u32 *p_fw_data;
939939
int frame = 0;
940-
u16 _buffer_size = 4096;
941940
u8 *p_buffer;
942941

943942
p_current_fw = vmalloc(1884180 * 4);
@@ -947,7 +946,7 @@ static int cx231xx_load_firmware(struct cx231xx *dev)
947946
return -ENOMEM;
948947
}
949948

950-
p_buffer = vmalloc(4096);
949+
p_buffer = vmalloc(EP5_BUF_SIZE);
951950
if (p_buffer == NULL) {
952951
dprintk(2, "FAIL!!!\n");
953952
vfree(p_current_fw);
@@ -1030,9 +1029,9 @@ static int cx231xx_load_firmware(struct cx231xx *dev)
10301029

10311030
/*download the firmware by ep5-out*/
10321031

1033-
for (frame = 0; frame < (int)(CX231xx_FIRM_IMAGE_SIZE*20/_buffer_size);
1032+
for (frame = 0; frame < (int)(CX231xx_FIRM_IMAGE_SIZE*20/EP5_BUF_SIZE);
10341033
frame++) {
1035-
for (i = 0; i < _buffer_size; i++) {
1034+
for (i = 0; i < EP5_BUF_SIZE; i++) {
10361035
*(p_buffer + i) = (u8)(*(p_fw + (frame * 128 * 8 + (i / 4))) & 0x000000FF);
10371036
i++;
10381037
*(p_buffer + i) = (u8)((*(p_fw + (frame * 128 * 8 + (i / 4))) & 0x0000FF00) >> 8);
@@ -1041,7 +1040,7 @@ static int cx231xx_load_firmware(struct cx231xx *dev)
10411040
i++;
10421041
*(p_buffer + i) = (u8)((*(p_fw + (frame * 128 * 8 + (i / 4))) & 0xFF000000) >> 24);
10431042
}
1044-
cx231xx_ep5_bulkout(dev, p_buffer, _buffer_size);
1043+
cx231xx_ep5_bulkout(dev, p_buffer, EP5_BUF_SIZE);
10451044
}
10461045

10471046
p_current_fw = p_fw;

drivers/media/usb/cx231xx/cx231xx-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,
993993
/* De-allocates all pending stuff */
994994
cx231xx_uninit_isoc(dev);
995995

996-
dma_q->p_left_data = kzalloc(4096, GFP_KERNEL);
996+
dma_q->p_left_data = kzalloc(EP5_BUF_SIZE, GFP_KERNEL);
997997
if (dma_q->p_left_data == NULL)
998998
return -ENOMEM;
999999

0 commit comments

Comments
 (0)