Re: [Cocci] linux-kernel janitorial RFP: Mark static arrays as const

2021-03-03 Thread Julia Lawall
On Tue, 2 Mar 2021, Bernd Petrovitsch wrote: > Hi all! > > On 02/03/2021 18:42, Joe Perches wrote: > [...] > > - For instance: (head -10 of the git grep for file statics) > > > > drivers/accessibility/speakup/keyhelp.c:18:static u_short masks[] = { 32, > > 16, 8, 4, 2, 1 }; > >

Re: [Cocci] linux-kernel janitorial RFP: Mark static arrays as const

2021-03-03 Thread Joe Perches
On Tue, 2021-03-02 at 22:41 +0100, Julia Lawall wrote: > > On Tue, 2 Mar 2021, Joe Perches wrote: > > > Here is a possible opportunity to reduce data usage in the kernel. > > Does it actually reduce data usage? Yes, at least for gcc. For instance: $ gcc --version gcc (Ubuntu

Re: [Cocci] linux-kernel janitorial RFP: Mark static arrays as const

2021-03-02 Thread Julia Lawall
On Tue, 2 Mar 2021, Joe Perches wrote: > Here is a possible opportunity to reduce data usage in the kernel. Does it actually reduce data usage? julia > > $ git grep -P -n '^static\s+(?!const|struct)(?:\w+\s+){1,3}\w+\s*\[\s*\]' > drivers/ | \ > grep -v __initdata | \ > wc -l > 3250 > >