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

2021-03-07 Thread Julia Lawall
On Sun, 7 Mar 2021, Joe Perches wrote: > On Sun, 2021-03-07 at 20:14 +0100, Julia Lawall wrote: > > > > On Wed, 3 Mar 2021, Joe Perches wrote: > > > > > On Wed, 2021-03-03 at 10:41 +0100, Rasmus Villemoes wrote: > > > > On 02/03/2021 18.42, Joe Perches wrote: > > > > > Here is a possible

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

2021-03-07 Thread Joe Perches
On Sun, 2021-03-07 at 20:14 +0100, Julia Lawall wrote: > > On Wed, 3 Mar 2021, Joe Perches wrote: > > > On Wed, 2021-03-03 at 10:41 +0100, Rasmus Villemoes wrote: > > > On 02/03/2021 18.42, Joe Perches wrote: > > > > Here is a possible opportunity to reduce data usage in the kernel. > > > > > >

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

2021-03-07 Thread Julia Lawall
On Wed, 3 Mar 2021, Joe Perches wrote: > On Wed, 2021-03-03 at 10:41 +0100, Rasmus Villemoes wrote: > > On 02/03/2021 18.42, Joe Perches wrote: > > > Here is a possible opportunity to reduce data usage in the kernel. > > > > > > $ git grep -P -n

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

2021-03-04 Thread Andy Shevchenko
On Wednesday, March 3, 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 Julia Lawall
On Wed, 3 Mar 2021, Mansour Moufid wrote: > On Tue, Mar 2, 2021 at 4:22 PM Joe Perches wrote: > > > > Here is a possible opportunity to reduce data usage in the kernel. > > > > $ git grep -P -n '^static\s+(?!const|struct)(?:\w+\s+){1,3}\w+\s*\[\s*\]' > > drivers/ | \ > > grep -v __initdata

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

2021-03-03 Thread Mansour Moufid
On Tue, Mar 2, 2021 at 4:22 PM Joe Perches wrote: > > Here is a possible opportunity to reduce data usage in the kernel. > > $ git grep -P -n '^static\s+(?!const|struct)(?:\w+\s+){1,3}\w+\s*\[\s*\]' > drivers/ | \ > grep -v __initdata | \ > wc -l > 3250 > > Meaning there are ~3000

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-03 Thread Joe Perches
On Wed, 2021-03-03 at 10:41 +0100, Rasmus Villemoes wrote: > On 02/03/2021 18.42, Joe Perches wrote: > > Here is a possible opportunity to reduce data usage in the kernel. > > > > $ git grep -P -n '^static\s+(?!const|struct)(?:\w+\s+){1,3}\w+\s*\[\s*\]' > > drivers/ | \ > >   grep -v __initdata

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

2021-03-03 Thread Rasmus Villemoes
On 02/03/2021 18.42, Joe Perches wrote: > Here is a possible opportunity to reduce data usage in the kernel. > > $ git grep -P -n '^static\s+(?!const|struct)(?:\w+\s+){1,3}\w+\s*\[\s*\]' > drivers/ | \ > grep -v __initdata | \ > wc -l > 3250 > > Meaning there are ~3000 declarations of

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

2021-03-03 Thread Bernd Petrovitsch
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 }; > drivers/accessibility/speakup/keyhelp.c:26:static u_char funcvals[]

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-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 > >

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

2021-03-02 Thread Joe Perches
Here is a possible opportunity to reduce data usage in the kernel. $ git grep -P -n '^static\s+(?!const|struct)(?:\w+\s+){1,3}\w+\s*\[\s*\]' drivers/ | \ grep -v __initdata | \ wc -l 3250 Meaning there are ~3000 declarations of arrays with what appears to be file static const content that