aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2007-02-13 15:53:46 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-02-21 10:35:33 -0500
commit47e76c5c7904b8bc2d4c08fbe531017b704a877d (patch)
treeefad015d6e276422e37c6db2fec15ee3fb0764e6
parentb79ea694a919ebc107c90af61b5d22becb1b1324 (diff)
V4L/DVB (5252): Qt1010: use ARRAY_SIZE macro when appropriate
Use ARRAY_SIZE macro already defined in kernel.h Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--drivers/media/dvb/frontends/qt1010.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/dvb/frontends/qt1010.c b/drivers/media/dvb/frontends/qt1010.c
index 28406b354c49..827cb0c625f9 100644
--- a/drivers/media/dvb/frontends/qt1010.c
+++ b/drivers/media/dvb/frontends/qt1010.c
@@ -233,7 +233,7 @@ static int qt1010_set_params(struct dvb_frontend *fe, struct dvb_frontend_parame
233 rd[10].val, rd[13].val, rd[14].val, rd[15].val, rd[35].val, \ 233 rd[10].val, rd[13].val, rd[14].val, rd[15].val, rd[35].val, \
234 rd[40].val, rd[41].val, rd[43].val, rd[45].val); 234 rd[40].val, rd[41].val, rd[43].val, rd[45].val);
235 235
236 for (i = 0; i < sizeof(rd) / sizeof(*rd); i++) { 236 for (i = 0; i < ARRAY_SIZE(rd); i++) {
237 if (rd[i].oper == QT1010_WR) { 237 if (rd[i].oper == QT1010_WR) {
238 err = qt1010_writereg(priv, rd[i].reg, rd[i].val); 238 err = qt1010_writereg(priv, rd[i].reg, rd[i].val);
239 } else { /* read is required to proper locking */ 239 } else { /* read is required to proper locking */
@@ -263,7 +263,7 @@ static int qt1010_init_meas1(struct qt1010_priv *priv, u8 oper, u8 reg, u8 reg_i
263 { QT1010_RD, reg, 0xff } 263 { QT1010_RD, reg, 0xff }
264 }; 264 };
265 265
266 for (i = 0; i < sizeof(i2c_data) / sizeof(*i2c_data); i++) { 266 for (i = 0; i < ARRAY_SIZE(i2c_data); i++) {
267 if (i2c_data[i].oper == QT1010_WR) { 267 if (i2c_data[i].oper == QT1010_WR) {
268 err = qt1010_writereg(priv, i2c_data[i].reg, i2c_data[i].val); 268 err = qt1010_writereg(priv, i2c_data[i].reg, i2c_data[i].val);
269 } else { 269 } else {
@@ -296,7 +296,7 @@ static u8 qt1010_init_meas2(struct qt1010_priv *priv, u8 reg_init_val, u8 *retva
296 { QT1010_WR, 0x1e, 0x00 }, 296 { QT1010_WR, 0x1e, 0x00 },
297 { QT1010_WR, 0x22, 0xff } 297 { QT1010_WR, 0x22, 0xff }
298 }; 298 };
299 for (i = 0; i < sizeof(i2c_data) / sizeof(*i2c_data); i++) { 299 for (i = 0; i < ARRAY_SIZE(i2c_data); i++) {
300 if (i2c_data[i].oper == QT1010_WR) { 300 if (i2c_data[i].oper == QT1010_WR) {
301 err = qt1010_writereg(priv, i2c_data[i].reg, i2c_data[i].val); 301 err = qt1010_writereg(priv, i2c_data[i].reg, i2c_data[i].val);
302 } else { 302 } else {
@@ -355,7 +355,7 @@ static int qt1010_init(struct dvb_frontend *fe)
355 if (fe->ops.i2c_gate_ctrl) 355 if (fe->ops.i2c_gate_ctrl)
356 fe->ops.i2c_gate_ctrl(fe, 1); /* open i2c_gate */ 356 fe->ops.i2c_gate_ctrl(fe, 1); /* open i2c_gate */
357 357
358 for (i = 0; i < sizeof(i2c_data) / sizeof(*i2c_data); i++) { 358 for (i = 0; i < ARRAY_SIZE(i2c_data); i++) {
359 switch (i2c_data[i].oper) { 359 switch (i2c_data[i].oper) {
360 case QT1010_WR: 360 case QT1010_WR:
361 err = qt1010_writereg(priv, i2c_data[i].reg, i2c_data[i].val); 361 err = qt1010_writereg(priv, i2c_data[i].reg, i2c_data[i].val);