From eca8ebfc11d1935a7dd4c59cb8defb5bdff44ecd Mon Sep 17 00:00:00 2001 From: "Ahmed S. Darwish" Date: Sat, 20 Jan 2007 00:35:03 -0300 Subject: V4L/DVB (5090): Pvrusb2: A patch to use ARRAY_SIZE macro when appropriate Signed-off-by: Ahmed S. Darwish Signed-off-by: Mike Isely Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/pvrusb2/pvrusb2-wm8775.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'drivers/media/video/pvrusb2/pvrusb2-wm8775.c') diff --git a/drivers/media/video/pvrusb2/pvrusb2-wm8775.c b/drivers/media/video/pvrusb2/pvrusb2-wm8775.c index 3f6bc4b117c..234adf7aa61 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-wm8775.c +++ b/drivers/media/video/pvrusb2/pvrusb2-wm8775.c @@ -105,8 +105,7 @@ static int wm8775_check(struct pvr2_v4l_wm8775 *ctxt) unsigned long msk; unsigned int idx; - for (idx = 0; idx < sizeof(wm8775_ops)/sizeof(wm8775_ops[0]); - idx++) { + for (idx = 0; idx < ARRAY_SIZE(wm8775_ops); idx++) { msk = 1 << idx; if (ctxt->stale_mask & msk) continue; if (wm8775_ops[idx].check(ctxt)) { @@ -122,8 +121,7 @@ static void wm8775_update(struct pvr2_v4l_wm8775 *ctxt) unsigned long msk; unsigned int idx; - for (idx = 0; idx < sizeof(wm8775_ops)/sizeof(wm8775_ops[0]); - idx++) { + for (idx = 0; idx < ARRAY_SIZE(wm8775_ops); idx++) { msk = 1 << idx; if (!(ctxt->stale_mask & msk)) continue; ctxt->stale_mask &= ~msk; @@ -154,8 +152,7 @@ int pvr2_i2c_wm8775_setup(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp) ctxt->handler.func_table = &hfuncs; ctxt->client = cp; ctxt->hdw = hdw; - ctxt->stale_mask = (1 << (sizeof(wm8775_ops)/ - sizeof(wm8775_ops[0]))) - 1; + ctxt->stale_mask = (1 << ARRAY_SIZE(wm8775_ops)) - 1; cp->handler = &ctxt->handler; pvr2_trace(PVR2_TRACE_CHIPS,"i2c 0x%x wm8775 V4L2 handler set up", cp->client->addr); -- cgit v1.2.3