Commit c1d57038 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

V4L/DVB (5477): CodingStyle cleanups on for loops at bttv-cards.c

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 57747b7f
...@@ -3638,7 +3638,7 @@ static int __devinit pvr_altera_load(struct bttv *btv, u8 *micro, u32 microlen) ...@@ -3638,7 +3638,7 @@ static int __devinit pvr_altera_load(struct bttv *btv, u8 *micro, u32 microlen)
for (n = 0; n < microlen; n++) { for (n = 0; n < microlen; n++) {
bits = micro[n]; bits = micro[n];
for ( i = 0 ; i < 8 ; i++ ) { for (i = 0 ; i < 8 ; i++) {
gpio_bits(BTTV_ALT_DCLK,0); gpio_bits(BTTV_ALT_DCLK,0);
if (bits & 0x01) if (bits & 0x01)
gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA); gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
...@@ -3691,7 +3691,7 @@ static void __devinit osprey_eeprom(struct bttv *btv) ...@@ -3691,7 +3691,7 @@ static void __devinit osprey_eeprom(struct bttv *btv)
/* this might be an antique... check for MMAC label in eeprom */ /* this might be an antique... check for MMAC label in eeprom */
if ((ee[0]=='M') && (ee[1]=='M') && (ee[2]=='A') && (ee[3]=='C')) { if ((ee[0]=='M') && (ee[1]=='M') && (ee[2]=='A') && (ee[3]=='C')) {
unsigned char checksum = 0; unsigned char checksum = 0;
for (i =0; i<21; i++) for (i = 0; i < 21; i++)
checksum += ee[i]; checksum += ee[i];
if (checksum != ee[21]) if (checksum != ee[21])
return; return;
...@@ -3703,10 +3703,11 @@ static void __devinit osprey_eeprom(struct bttv *btv) ...@@ -3703,10 +3703,11 @@ static void __devinit osprey_eeprom(struct bttv *btv)
unsigned short type; unsigned short type;
int offset = 4*16; int offset = 4*16;
for(; offset < 8*16; offset += 16) { for (; offset < 8*16; offset += 16) {
unsigned short checksum = 0; unsigned short checksum = 0;
/* verify the checksum */ /* verify the checksum */
for(i = 0; i<14; i++) checksum += ee[i+offset]; for (i = 0; i < 14; i++)
checksum += ee[i+offset];
checksum = ~checksum; /* no idea why */ checksum = ~checksum; /* no idea why */
if ((((checksum>>8)&0x0FF) == ee[offset+14]) && if ((((checksum>>8)&0x0FF) == ee[offset+14]) &&
((checksum & 0x0FF) == ee[offset+15])) { ((checksum & 0x0FF) == ee[offset+15])) {
...@@ -3721,7 +3722,6 @@ static void __devinit osprey_eeprom(struct bttv *btv) ...@@ -3721,7 +3722,6 @@ static void __devinit osprey_eeprom(struct bttv *btv)
type = (ee[offset+4]<<8) | (ee[offset+5]); type = (ee[offset+4]<<8) | (ee[offset+5]);
switch(type) { switch(type) {
/* 848 based */ /* 848 based */
case 0x0004: case 0x0004:
btv->c.type = BTTV_BOARD_OSPREY1x0_848; btv->c.type = BTTV_BOARD_OSPREY1x0_848;
...@@ -4149,8 +4149,7 @@ static int tea5757_read(struct bttv *btv) ...@@ -4149,8 +4149,7 @@ static int tea5757_read(struct bttv *btv)
} }
dprintk("bttv%d: tea5757:",btv->c.nr); dprintk("bttv%d: tea5757:",btv->c.nr);
for(i = 0; i < 24; i++) for (i = 0; i < 24; i++) {
{
udelay(5); udelay(5);
bus_high(btv,btv->mbox_clk); bus_high(btv,btv->mbox_clk);
udelay(5); udelay(5);
...@@ -4182,8 +4181,7 @@ static int tea5757_write(struct bttv *btv, int value) ...@@ -4182,8 +4181,7 @@ static int tea5757_write(struct bttv *btv, int value)
dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value); dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value);
bus_low(btv,btv->mbox_clk); bus_low(btv,btv->mbox_clk);
bus_high(btv,btv->mbox_we); bus_high(btv,btv->mbox_we);
for(i = 0; i < 25; i++) for (i = 0; i < 25; i++) {
{
if (reg & 0x1000000) if (reg & 0x1000000)
bus_high(btv,btv->mbox_data); bus_high(btv,btv->mbox_data);
else else
...@@ -4755,7 +4753,7 @@ static void kodicom4400r_init(struct bttv *btv) ...@@ -4755,7 +4753,7 @@ static void kodicom4400r_init(struct bttv *btv)
gpio_write(1 << 9); /* reset MUX */ gpio_write(1 << 9); /* reset MUX */
gpio_write(0); gpio_write(0);
/* Preset camera 0 to the 4 controllers */ /* Preset camera 0 to the 4 controllers */
for (ix=0; ix<4; ix++) { for (ix = 0; ix < 4; ix++) {
sw_status[ix] = ix; sw_status[ix] = ix;
kodicom4400r_write(btv, ix, ix, 1); kodicom4400r_write(btv, ix, ix, 1);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment