提交 53c4e955 编写于 作者: M Mauro Carvalho Chehab

V4L/DVB (5479): Use ARRAY_SIZE instead of a magic number

Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
上级 5b9c4e6d
......@@ -412,7 +412,7 @@ static void do_i2c_scan(char *name, struct i2c_client *c)
unsigned char buf;
int i,rc;
for (i = 0; i < 128; i++) {
for (i = 0; i < ARRAY_SIZE(i2c_devs); i++) {
c->addr = i;
rc = i2c_master_recv(c,&buf,0);
if (rc < 0)
......
/*
cx88-i2c.c -- all the i2c code is here
......@@ -195,7 +196,7 @@ static void do_i2c_scan(char *name, struct i2c_client *c)
unsigned char buf;
int i,rc;
for (i = 0; i < 128; i++) {
for (i = 0; i < ARRAY_SIZE(i2c_devs); i++) {
c->addr = i;
rc = i2c_master_recv(c,&buf,0);
if (rc < 0)
......
......@@ -523,7 +523,7 @@ static void do_i2c_scan(char *name, struct i2c_client *c)
unsigned char buf;
int i, rc;
for (i = 0; i < 128; i++) {
for (i = 0; i < ARRAY_SIZE(i2c_devs); i++) {
c->addr = i;
rc = i2c_master_recv(c, &buf, 0);
if (rc < 0)
......
......@@ -173,7 +173,7 @@ static int get_key_pinnacle(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw,
return -EIO;
}
for (start = 0; start<4; start++) {
for (start = 0; start < ARRAY_SIZE(b); start++) {
if (b[start] == marker) {
code=b[(start+parity_offset+1)%4];
parity=b[(start+parity_offset)%4];
......
......@@ -447,7 +447,7 @@ static void do_i2c_scan(char *name, struct i2c_client *c)
unsigned char buf;
int i,rc;
for (i = 0; i < 128; i++) {
for (i = 0; i < ARRAY_SIZE(i2c_devs); i++) {
c->addr = i;
rc = i2c_master_recv(c,&buf,0);
if (rc < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册