Commit a45c9275 authored by Michael Krufky's avatar Michael Krufky Committed by Mauro Carvalho Chehab

V4L/DVB (5949): s5h1409: use ARRAY_SIZE macro when appropriate

Use ARRAY_SIZE macro already defined in kernel.h
Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 89885558
...@@ -476,7 +476,7 @@ static int s5h1409_init (struct dvb_frontend* fe) ...@@ -476,7 +476,7 @@ static int s5h1409_init (struct dvb_frontend* fe)
s5h1409_sleep(fe, 0); s5h1409_sleep(fe, 0);
s5h1409_register_reset(fe); s5h1409_register_reset(fe);
for (i=0; i<sizeof(init_tab) / sizeof (struct init_tab); i++) for (i=0; i < ARRAY_SIZE(init_tab); i++)
s5h1409_writereg(state, init_tab[i].reg, init_tab[i].data); s5h1409_writereg(state, init_tab[i].reg, init_tab[i].data);
/* The datasheet says that after initialisation, VSB is default */ /* The datasheet says that after initialisation, VSB is default */
...@@ -542,7 +542,7 @@ static int s5h1409_qam256_lookup_snr(struct dvb_frontend* fe, u16* snr, u16 v) ...@@ -542,7 +542,7 @@ static int s5h1409_qam256_lookup_snr(struct dvb_frontend* fe, u16* snr, u16 v)
int i, ret = -EINVAL; int i, ret = -EINVAL;
dprintk("%s()\n", __FUNCTION__); dprintk("%s()\n", __FUNCTION__);
for (i=0; i<sizeof(qam256_snr_tab) / (sizeof(struct qam256_snr_tab)); i++) { for (i=0; i < ARRAY_SIZE(qam256_snr_tab); i++) {
if (v < qam256_snr_tab[i].val) { if (v < qam256_snr_tab[i].val) {
*snr = qam256_snr_tab[i].data; *snr = qam256_snr_tab[i].data;
ret = 0; ret = 0;
...@@ -557,7 +557,7 @@ static int s5h1409_qam64_lookup_snr(struct dvb_frontend* fe, u16* snr, u16 v) ...@@ -557,7 +557,7 @@ static int s5h1409_qam64_lookup_snr(struct dvb_frontend* fe, u16* snr, u16 v)
int i, ret = -EINVAL; int i, ret = -EINVAL;
dprintk("%s()\n", __FUNCTION__); dprintk("%s()\n", __FUNCTION__);
for (i=0; i<sizeof(qam64_snr_tab) / (sizeof(struct qam64_snr_tab)); i++) { for (i=0; i < ARRAY_SIZE(qam64_snr_tab); i++) {
if (v < qam64_snr_tab[i].val) { if (v < qam64_snr_tab[i].val) {
*snr = qam64_snr_tab[i].data; *snr = qam64_snr_tab[i].data;
ret = 0; ret = 0;
...@@ -572,7 +572,7 @@ static int s5h1409_vsb_lookup_snr(struct dvb_frontend* fe, u16* snr, u16 v) ...@@ -572,7 +572,7 @@ static int s5h1409_vsb_lookup_snr(struct dvb_frontend* fe, u16* snr, u16 v)
int i, ret = -EINVAL; int i, ret = -EINVAL;
dprintk("%s()\n", __FUNCTION__); dprintk("%s()\n", __FUNCTION__);
for (i=0; i<sizeof(vsb_snr_tab) / (sizeof(struct vsb_snr_tab)); i++) { for (i=0; i < ARRAY_SIZE(vsb_snr_tab); i++) {
if (v > vsb_snr_tab[i].val) { if (v > vsb_snr_tab[i].val) {
*snr = vsb_snr_tab[i].data; *snr = vsb_snr_tab[i].data;
ret = 0; ret = 0;
......
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