summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.c
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2007-01-19 21:35:03 -0600
committerMike Isely <isely@pobox.com>2007-01-19 21:35:03 -0600
commit407531b06687d03d31880527a6383317bc579559 (patch)
tree8e2efe042bd5e5a707c67e73a05fbc6855a66db1 /linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.c
parentfeed15939f4b35e6280df65e4c223aaef5cc3c2e (diff)
downloadmediapointer-dvb-s2-407531b06687d03d31880527a6383317bc579559.tar.gz
mediapointer-dvb-s2-407531b06687d03d31880527a6383317bc579559.tar.bz2
pvrusb2: A patch to use ARRAY_SIZE macro when appropriate
From: Ahmed S. Darwish <darwish.07@gmail.com> Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com> Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.c')
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.c b/linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.c
index ce08dee9b..000c5352b 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.c
+++ b/linux/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);