aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c
diff options
context:
space:
mode:
authorAhmed S. Darwish <darwish.07@gmail.com>2007-01-19 22:35:03 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-02-21 10:34:40 -0500
commiteca8ebfc11d1935a7dd4c59cb8defb5bdff44ecd (patch)
tree818ee1c4b8accd26a3b30599ba6058a73b9d5c02 /drivers/media/video/pvrusb2/pvrusb2-video-v4l.c
parentc1c2680d922cd36338cf3efaf4ce0067c3e26eb1 (diff)
V4L/DVB (5090): Pvrusb2: A patch to use ARRAY_SIZE macro when appropriate
Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com> 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-video-v4l.c')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-video-v4l.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c b/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c
index 10a735ceee2..7f42042c201 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c
@@ -139,8 +139,7 @@ static int decoder_check(struct pvr2_v4l_decoder *ctxt)
139 unsigned long msk; 139 unsigned long msk;
140 unsigned int idx; 140 unsigned int idx;
141 141
142 for (idx = 0; idx < sizeof(decoder_ops)/sizeof(decoder_ops[0]); 142 for (idx = 0; idx < ARRAY_SIZE(decoder_ops); idx++) {
143 idx++) {
144 msk = 1 << idx; 143 msk = 1 << idx;
145 if (ctxt->stale_mask & msk) continue; 144 if (ctxt->stale_mask & msk) continue;
146 if (decoder_ops[idx].check(ctxt)) { 145 if (decoder_ops[idx].check(ctxt)) {
@@ -156,8 +155,7 @@ static void decoder_update(struct pvr2_v4l_decoder *ctxt)
156 unsigned long msk; 155 unsigned long msk;
157 unsigned int idx; 156 unsigned int idx;
158 157
159 for (idx = 0; idx < sizeof(decoder_ops)/sizeof(decoder_ops[0]); 158 for (idx = 0; idx < ARRAY_SIZE(decoder_ops); idx++) {
160 idx++) {
161 msk = 1 << idx; 159 msk = 1 << idx;
162 if (!(ctxt->stale_mask & msk)) continue; 160 if (!(ctxt->stale_mask & msk)) continue;
163 ctxt->stale_mask &= ~msk; 161 ctxt->stale_mask &= ~msk;
@@ -219,8 +217,7 @@ int pvr2_i2c_decoder_v4l_setup(struct pvr2_hdw *hdw,
219 ctxt->ctrl.enable = (void (*)(void *,int))decoder_enable; 217 ctxt->ctrl.enable = (void (*)(void *,int))decoder_enable;
220 ctxt->client = cp; 218 ctxt->client = cp;
221 ctxt->hdw = hdw; 219 ctxt->hdw = hdw;
222 ctxt->stale_mask = (1 << (sizeof(decoder_ops)/ 220 ctxt->stale_mask = (1 << ARRAY_SIZE(decoder_ops)) - 1;
223 sizeof(decoder_ops[0]))) - 1;
224 hdw->decoder_ctrl = &ctxt->ctrl; 221 hdw->decoder_ctrl = &ctxt->ctrl;
225 cp->handler = &ctxt->handler; 222 cp->handler = &ctxt->handler;
226 pvr2_trace(PVR2_TRACE_CHIPS,"i2c 0x%x saa711x V4L2 handler set up", 223 pvr2_trace(PVR2_TRACE_CHIPS,"i2c 0x%x saa711x V4L2 handler set up",