Skip to content

Commit

Permalink
[media] rtl2832.c: minor cleanup
Browse files Browse the repository at this point in the history
The current formulation of the bw_params loop uses the counter j as an
index for the first dimension of the bw_params array which is later
incremented by the variable i. It is evaluated correctly only, because j
is initialized to 0 at the beginning of the loop. I think that
explicitly using the index 0 better reflects the intent of the
expression.

Signed-off-by: Hans-Frieder Vogt <hfvogt@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Hans-Frieder Vogt authored and Mauro Carvalho Chehab committed Jul 31, 2012
1 parent 26ff631 commit fc4b3fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/dvb/frontends/rtl2832.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ static int rtl2832_set_frontend(struct dvb_frontend *fe)
return -EINVAL;
}

for (j = 0; j < sizeof(bw_params[j]); j++) {
for (j = 0; j < sizeof(bw_params[0]); j++) {
ret = rtl2832_wr_regs(priv, 0x1c+j, 1, &bw_params[i][j], 1);
if (ret)
goto err;
Expand Down

0 comments on commit fc4b3fa

Please sign in to comment.