]> git.baikalelectronics.ru Git - kernel.git/commit
drm/via: use ARRAY_SIZE
authorJérémy Lefaure <jeremy.lefaure@lse.epita.fr>
Mon, 16 Oct 2017 02:33:56 +0000 (22:33 -0400)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 16 Oct 2017 09:29:28 +0000 (11:29 +0200)
commit2e20c9ddae0b3770abca4b9b1a5243d6841bdd84
tree4a4f42a95cb2847504c196bcacbf80d05689c7b4
parentc7d234dc671d17c4c9b89fd30102a2fc619ecf7e
drm/via: use ARRAY_SIZE

Using the ARRAY_SIZE macro improves the readability of the code.

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/20171016023357.20174-1-jeremy.lefaure@lse.epita.fr
drivers/gpu/drm/via/via_verifier.c