]> git.baikalelectronics.ru Git - kernel.git/commit
IB/mlx5: Use ARRAY_SIZE
authorJérémy Lefaure <jeremy.lefaure@lse.epita.fr>
Mon, 16 Oct 2017 05:45:17 +0000 (08:45 +0300)
committerDoug Ledford <dledford@redhat.com>
Wed, 18 Oct 2017 16:16:14 +0000 (12:16 -0400)
commit577028e5d5e62d7d7bae153a397a77fde0a4ac90
tree644a64b104e9cfdbc4cf7d80cd756cf36d454a13
parentd8aede907eef8d4187c67be8d78fcd84f5635fc2
IB/mlx5: 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))
)

Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/mlx5/odp.c