Re: [PATCH 13/18] tpm: use ARRAY_SIZE

2017-10-11 Thread Jarkko Sakkinen
On Tue, Oct 10, 2017 at 04:30:11PM -0400, Jérémy Lefaure wrote: > On Wed, 4 Oct 2017 15:14:49 +0300 > Jarkko Sakkinen wrote: > > > On Sun, Oct 01, 2017 at 03:30:51PM -0400, Jérémy Lefaure wrote: > > > Using the ARRAY_SIZE macro improves the readability of the code. > > > > > > Found with Coccine

Re: [PATCH 13/18] tpm: use ARRAY_SIZE

2017-10-10 Thread Jérémy Lefaure
On Wed, 4 Oct 2017 15:14:49 +0300 Jarkko Sakkinen wrote: > On Sun, Oct 01, 2017 at 03:30:51PM -0400, Jérémy Lefaure wrote: > > Using the ARRAY_SIZE macro improves the readability of the code. > > > > Found with Coccinelle with the following semantic patch: > > @r depends on (org || report)@ > >

Re: [PATCH 13/18] tpm: use ARRAY_SIZE

2017-10-04 Thread Jarkko Sakkinen
On Sun, Oct 01, 2017 at 03:30:51PM -0400, Jérémy Lefaure wrote: > 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)) >

[PATCH 13/18] tpm: use ARRAY_SIZE

2017-10-01 Thread Jérémy Lefaure
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