diff options
author | Mike Isely <isely@pobox.com> | 2007-01-19 22:39:17 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-02-21 10:34:41 -0500 |
commit | 27c7b710a4010e10b14500c0b27bb4c2a806de1b (patch) | |
tree | 5f4285057225c3c08e2d560dfc1c298ac3e738d5 /drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c | |
parent | ca545f7c39476c6c4c6e639452180a2b38342669 (diff) |
V4L/DVB (5092): Pvrusb2: Use ARRAY_SIZE wherever possible
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c b/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c index 851099a85e5a..e8a9252c7df6 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c +++ b/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c | |||
@@ -150,8 +150,7 @@ static int decoder_check(struct pvr2_v4l_cx2584x *ctxt) | |||
150 | unsigned long msk; | 150 | unsigned long msk; |
151 | unsigned int idx; | 151 | unsigned int idx; |
152 | 152 | ||
153 | for (idx = 0; idx < sizeof(decoder_ops)/sizeof(decoder_ops[0]); | 153 | for (idx = 0; idx < ARRAY_SIZE(decoder_ops); idx++) { |
154 | idx++) { | ||
155 | msk = 1 << idx; | 154 | msk = 1 << idx; |
156 | if (ctxt->stale_mask & msk) continue; | 155 | if (ctxt->stale_mask & msk) continue; |
157 | if (decoder_ops[idx].check(ctxt)) { | 156 | if (decoder_ops[idx].check(ctxt)) { |
@@ -167,8 +166,7 @@ static void decoder_update(struct pvr2_v4l_cx2584x *ctxt) | |||
167 | unsigned long msk; | 166 | unsigned long msk; |
168 | unsigned int idx; | 167 | unsigned int idx; |
169 | 168 | ||
170 | for (idx = 0; idx < sizeof(decoder_ops)/sizeof(decoder_ops[0]); | 169 | for (idx = 0; idx < ARRAY_SIZE(decoder_ops); idx++) { |
171 | idx++) { | ||
172 | msk = 1 << idx; | 170 | msk = 1 << idx; |
173 | if (!(ctxt->stale_mask & msk)) continue; | 171 | if (!(ctxt->stale_mask & msk)) continue; |
174 | ctxt->stale_mask &= ~msk; | 172 | ctxt->stale_mask &= ~msk; |
@@ -242,8 +240,7 @@ int pvr2_i2c_cx2584x_v4l_setup(struct pvr2_hdw *hdw, | |||
242 | ctxt->ctrl.force_reset = (void (*)(void*))decoder_reset; | 240 | ctxt->ctrl.force_reset = (void (*)(void*))decoder_reset; |
243 | ctxt->client = cp; | 241 | ctxt->client = cp; |
244 | ctxt->hdw = hdw; | 242 | ctxt->hdw = hdw; |
245 | ctxt->stale_mask = (1 << (sizeof(decoder_ops)/ | 243 | ctxt->stale_mask = (1 << ARRAY_SIZE(decoder_ops)) - 1; |
246 | sizeof(decoder_ops[0]))) - 1; | ||
247 | hdw->decoder_ctrl = &ctxt->ctrl; | 244 | hdw->decoder_ctrl = &ctxt->ctrl; |
248 | cp->handler = &ctxt->handler; | 245 | cp->handler = &ctxt->handler; |
249 | { | 246 | { |