Re: [PATCH 01/18] sound: use ARRAY_SIZE

2017-10-03 Thread Takashi Iwai
On Sun, 01 Oct 2017 21:30:39 +0200, 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)) > | >

Re: [PATCH 01/18] sound: use ARRAY_SIZE

2017-10-02 Thread Jérémy Lefaure
On Sun, 01 Oct 2017 21:16:19 -0700 Joe Perches wrote: > These sorts of changes are OK, but for many > uses, it's more readable to use ARRAY_SIZE(foo) > in each location rather than using a temporary. You're right, I missed that one. I will send a v2. Thank you for your review, Jérémy

Re: [PATCH 01/18] sound: use ARRAY_SIZE

2017-10-01 Thread Joe Perches
On Sun, 2017-10-01 at 15:30 -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 01/18] sound: 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