V4L/DVB (9638): drivers/media: use ARRAY_SIZE
authorJulia Lawall <julia@diku.dk>
Thu, 13 Nov 2008 02:18:21 +0000 (23:18 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 29 Dec 2008 19:53:34 +0000 (17:53 -0200)
commit802971257a3b897d2affd39e540be264bae89c3b
treebcfb454260c3b8ca052f76f84e130a1e50f8ac43
parent292ee46107abc213fc073298aa6a838a595d2b78
V4L/DVB (9638): drivers/media: use ARRAY_SIZE

ARRAY_SIZE is more concise to use when the size of an array is divided by
the size of its type or the size of its first element.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@i@
@@

@depends on i using "paren.iso"@
type T;
T[] E;
@@

- (sizeof(E)/sizeof(E[...]))
+ ARRAY_SIZE(E)

@depends on i using "paren.iso"@
type T;
T[] E;
@@

- (sizeof(E)/sizeof(T))
+ ARRAY_SIZE(E)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/common/tuners/mxl5005s.c
drivers/media/video/gspca/gspca.c
drivers/media/video/gspca/mars.c
drivers/media/video/gspca/spca500.c
drivers/media/video/saa7134/saa7134-tvaudio.c