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] [PATCH v2] coccinelle: misc: add swap script

2021-03-03 Thread Julia Lawall
On Fri, 19 Feb 2021, Denis Efremov wrote: > Check for opencoded swap() implementation. > > Signed-off-by: Denis Efremov > --- > Changes in v2: > - additional patch rule to drop excessive {} > - fix indentation in patch mode by anchoring ; > > scripts/coccinelle/misc/swap.cocci | 101

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