diff options
author | Ahmed S. Darwish <darwish.07@gmail.com> | 2007-01-19 22:35:03 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-02-21 10:34:40 -0500 |
commit | eca8ebfc11d1935a7dd4c59cb8defb5bdff44ecd (patch) | |
tree | 818ee1c4b8accd26a3b30599ba6058a73b9d5c02 /drivers/media/video/pvrusb2/pvrusb2-wm8775.c | |
parent | c1c2680d922cd36338cf3efaf4ce0067c3e26eb1 (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-wm8775.c')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-wm8775.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-wm8775.c b/drivers/media/video/pvrusb2/pvrusb2-wm8775.c index 3f6bc4b117c7..234adf7aa614 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) | |||
105 | unsigned long msk; | 105 | unsigned long msk; |
106 | unsigned int idx; | 106 | unsigned int idx; |
107 | 107 | ||
108 | for (idx = 0; idx < sizeof(wm8775_ops)/sizeof(wm8775_ops[0]); | 108 | for (idx = 0; idx < ARRAY_SIZE(wm8775_ops); idx++) { |
109 | idx++) { | ||
110 | msk = 1 << idx; | 109 | msk = 1 << idx; |
111 | if (ctxt->stale_mask & msk) continue; | 110 | if (ctxt->stale_mask & msk) continue; |
112 | if (wm8775_ops[idx].check(ctxt)) { | 111 | if (wm8775_ops[idx].check(ctxt)) { |
@@ -122,8 +121,7 @@ static void wm8775_update(struct pvr2_v4l_wm8775 *ctxt) | |||
122 | unsigned long msk; | 121 | unsigned long msk; |
123 | unsigned int idx; | 122 | unsigned int idx; |
124 | 123 | ||
125 | for (idx = 0; idx < sizeof(wm8775_ops)/sizeof(wm8775_ops[0]); | 124 | for (idx = 0; idx < ARRAY_SIZE(wm8775_ops); idx++) { |
126 | idx++) { | ||
127 | msk = 1 << idx; | 125 | msk = 1 << idx; |
128 | if (!(ctxt->stale_mask & msk)) continue; | 126 | if (!(ctxt->stale_mask & msk)) continue; |
129 | ctxt->stale_mask &= ~msk; | 127 | ctxt->stale_mask &= ~msk; |
@@ -154,8 +152,7 @@ int pvr2_i2c_wm8775_setup(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp) | |||
154 | ctxt->handler.func_table = &hfuncs; | 152 | ctxt->handler.func_table = &hfuncs; |
155 | ctxt->client = cp; | 153 | ctxt->client = cp; |
156 | ctxt->hdw = hdw; | 154 | ctxt->hdw = hdw; |
157 | ctxt->stale_mask = (1 << (sizeof(wm8775_ops)/ | 155 | ctxt->stale_mask = (1 << ARRAY_SIZE(wm8775_ops)) - 1; |
158 | sizeof(wm8775_ops[0]))) - 1; | ||
159 | cp->handler = &ctxt->handler; | 156 | cp->handler = &ctxt->handler; |
160 | pvr2_trace(PVR2_TRACE_CHIPS,"i2c 0x%x wm8775 V4L2 handler set up", | 157 | pvr2_trace(PVR2_TRACE_CHIPS,"i2c 0x%x wm8775 V4L2 handler set up", |
161 | cp->client->addr); | 158 | cp->client->addr); |