]> git.baikalelectronics.ru Git - kernel.git/commit
dm space map metadata: use ARRAY_SIZE
authorJérémy Lefaure <jeremy.lefaure@lse.epita.fr>
Sun, 1 Oct 2017 19:30:49 +0000 (15:30 -0400)
committerMike Snitzer <snitzer@redhat.com>
Fri, 10 Nov 2017 20:44:52 +0000 (15:44 -0500)
commit115082bc0c220a2ff3a4bab80fd809d7fd3d9c74
tree57d695fa21a87bcb9cb41fd80780d1065daa1b28
parentad0b81165fd0dbddae31dd271c708638ff080fdf
dm space map metadata: 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: Mike Snitzer <snitzer@redhat.com>
drivers/md/persistent-data/dm-space-map-metadata.c