]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (5252): Qt1010: use ARRAY_SIZE macro when appropriate
authorMichael Krufky <mkrufky@linuxtv.org>
Tue, 13 Feb 2007 20:53:46 +0000 (17:53 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Wed, 21 Feb 2007 15:35:33 +0000 (13:35 -0200)
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>
drivers/media/dvb/frontends/qt1010.c

index 28406b354c497207d4a668c83d2ba42987f30f61..827cb0c625f90ce2c5a6ab364c23b2e8f2b62cae 100644 (file)
@@ -233,7 +233,7 @@ static int qt1010_set_params(struct dvb_frontend *fe, struct dvb_frontend_parame
                rd[10].val, rd[13].val, rd[14].val, rd[15].val, rd[35].val, \
                rd[40].val, rd[41].val, rd[43].val, rd[45].val);
 
-       for (i = 0; i < sizeof(rd) / sizeof(*rd); i++) {
+       for (i = 0; i < ARRAY_SIZE(rd); i++) {
                if (rd[i].oper == QT1010_WR) {
                        err = qt1010_writereg(priv, rd[i].reg, rd[i].val);
                } 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
                { QT1010_RD, reg, 0xff }
        };
 
-       for (i = 0; i < sizeof(i2c_data) / sizeof(*i2c_data); i++) {
+       for (i = 0; i < ARRAY_SIZE(i2c_data); i++) {
                if (i2c_data[i].oper == QT1010_WR) {
                        err = qt1010_writereg(priv, i2c_data[i].reg, i2c_data[i].val);
                } else {
@@ -296,7 +296,7 @@ static u8 qt1010_init_meas2(struct qt1010_priv *priv, u8 reg_init_val, u8 *retva
                { QT1010_WR, 0x1e, 0x00 },
                { QT1010_WR, 0x22, 0xff }
        };
-       for (i = 0; i < sizeof(i2c_data) / sizeof(*i2c_data); i++) {
+       for (i = 0; i < ARRAY_SIZE(i2c_data); i++) {
                if (i2c_data[i].oper == QT1010_WR) {
                        err = qt1010_writereg(priv, i2c_data[i].reg, i2c_data[i].val);
                } else {
@@ -355,7 +355,7 @@ static int qt1010_init(struct dvb_frontend *fe)
        if (fe->ops.i2c_gate_ctrl)
                fe->ops.i2c_gate_ctrl(fe, 1); /* open i2c_gate */
 
-       for (i = 0; i < sizeof(i2c_data) / sizeof(*i2c_data); i++) {
+       for (i = 0; i < ARRAY_SIZE(i2c_data); i++) {
                switch (i2c_data[i].oper) {
                case QT1010_WR:
                        err = qt1010_writereg(priv, i2c_data[i].reg, i2c_data[i].val);