]> asedeno.scripts.mit.edu Git - linux.git/commit
ecryptfs: use ARRAY_SIZE
authorJérémy Lefaure <jeremy.lefaure@lse.epita.fr>
Sun, 1 Oct 2017 19:30:46 +0000 (15:30 -0400)
committerTyler Hicks <tyhicks@canonical.com>
Mon, 6 Nov 2017 18:23:59 +0000 (18:23 +0000)
commit02f9876ebb5e9cd31013c62b8839508b2dc152f0
treedaba01fc309974a4da5457b2b5d382861a3a9594
parent5032f360dd31e6cf59aadad0478df1244bfd30f8
ecryptfs: 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: Tyler Hicks <tyhicks@canonical.com>
fs/ecryptfs/crypto.c