]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
drm/amdgpu: use ARRAY_SIZE
authorJérémy Lefaure <jeremy.lefaure@lse.epita.fr>
Mon, 16 Oct 2017 02:29:23 +0000 (22:29 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 19 Oct 2017 19:27:11 +0000 (15:27 -0400)
commitc1b24a1405ed8720f5837fc77fbc52fd008cbb42
tree005ff7c635183d02b14ef07ad2bd486e07b3ac2c
parent2642cf110d08a403f585a051e4cbf45a90b3adea
drm/amdgpu: 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: Christian König <christian.koenig@amd.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c