]> git.baikalelectronics.ru Git - kernel.git/commit
drm/gma500: use ARRAY_SIZE
authorJérémy Lefaure <jeremy.lefaure@lse.epita.fr>
Mon, 16 Oct 2017 02:30:46 +0000 (22:30 -0400)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 16 Oct 2017 09:29:05 +0000 (11:29 +0200)
commitc7d234dc671d17c4c9b89fd30102a2fc619ecf7e
tree8dc31811d65284c5895f5bdeb1a70d5ec20eb98c
parentbfddd1469740ea27439afa866bff41ef1cd22bb1
drm/gma500: use ARRAY_SIZE

Using the ARRAY_SIZE macro improves the readability of the code. Also,
it is useless to re-invent it.

Found with Coccinelle with the following semantic patch:
@r depends on (org || report)@
type T;
T[] E;
position p;
@@
(
 (sizeof(E)@p /sizeof(*E))
|
 (sizeof(E)@p /sizeof(E[...]))
|
 (sizeof(E)@p /sizeof(T))
)

Reviewed-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20171016023047.19145-1-jeremy.lefaure@lse.epita.fr
drivers/gpu/drm/gma500/psb_intel_sdvo.c