aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx231xx/cx231xx-417.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-10-07 02:33:00 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-20 23:17:46 -0400
commitbae94dc39e9530842379208c4406512d34dc7ef3 (patch)
tree309b10639370e4bee3036ad960c2041abeecacb3 /drivers/media/video/cx231xx/cx231xx-417.c
parent955e6ed843ddddb57cf599584574c505175cd86f (diff)
[media] cx231xx-417: Fix a gcc warning
gcc didn't like to have i++ inside a complex operation: drivers/media/video/cx231xx/cx231xx-417.c: In function ‘cx231xx_load_firmware’: drivers/media/video/cx231xx/cx231xx-417.c:1059: warning: operation on ‘i’ may be undefined drivers/media/video/cx231xx/cx231xx-417.c:1061: warning: operation on ‘i’ may be undefined drivers/media/video/cx231xx/cx231xx-417.c:1063: warning: operation on ‘i’ may be undefined Btw, I agree with gcc, as we're using i and i++ at the same operation and, depending on how optimization may occur, it may produce a wrong code. While here, fix CodingStyle issues on the changed code. Acked-by: Sri Deevi <Srinivasa.Deevi@conexant.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx231xx/cx231xx-417.c')
-rw-r--r--drivers/media/video/cx231xx/cx231xx-417.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/media/video/cx231xx/cx231xx-417.c b/drivers/media/video/cx231xx/cx231xx-417.c
index a5b1b13d1fd6..b5b69989ff8d 100644
--- a/drivers/media/video/cx231xx/cx231xx-417.c
+++ b/drivers/media/video/cx231xx/cx231xx-417.c
@@ -1053,16 +1053,15 @@ static int cx231xx_load_firmware(struct cx231xx *dev)
1053 /*download the firmware by ep5-out*/ 1053 /*download the firmware by ep5-out*/
1054 1054
1055 for (frame = 0; frame < (int)(CX231xx_FIRM_IMAGE_SIZE*20/_buffer_size); 1055 for (frame = 0; frame < (int)(CX231xx_FIRM_IMAGE_SIZE*20/_buffer_size);
1056 frame++) { 1056 frame++) {
1057 for (i = 0; i < _buffer_size; i++) { 1057 for (i = 0; i < _buffer_size; i++) {
1058 *(p_buffer+i) = 1058 *(p_buffer + i) = (u8)(*(p_fw + (frame * 128 * 8 + (i / 4))) & 0x000000FF);
1059 (u8)(*(p_fw+(frame*128*8+(i++/4))) & 0x000000FF); 1059 i++;
1060 *(p_buffer+i) = 1060 *(p_buffer + i) = (u8)((*(p_fw + (frame * 128 * 8 + (i / 4))) & 0x0000FF00) >> 8);
1061 (u8)((*(p_fw+(frame*128*8+(i++/4))) & 0x0000FF00)>>8); 1061 i++;
1062 *(p_buffer+i) = 1062 *(p_buffer + i) = (u8)((*(p_fw + (frame * 128 * 8 + (i / 4))) & 0x00FF0000) >> 16);
1063 (u8)((*(p_fw+(frame*128*8+(i++/4))) & 0x00FF0000)>>16); 1063 i++;
1064 *(p_buffer+i) = 1064 *(p_buffer + i) = (u8)((*(p_fw + (frame * 128 * 8 + (i / 4))) & 0xFF000000) >> 24);
1065 (u8)((*(p_fw+(frame*128*8+(i/4))) & 0xFF000000)>>24);
1066 } 1065 }
1067 cx231xx_ep5_bulkout(dev, p_buffer, _buffer_size); 1066 cx231xx_ep5_bulkout(dev, p_buffer, _buffer_size);
1068 } 1067 }