Re: [PATCH v3 1/2] kernel.h: removed REPEAT_BYTE from kernel.h

2023-12-19 Thread Andy Shevchenko
On Mon, Dec 18, 2023 at 06:44:47PM +, tanz...@google.com wrote: > This patch creates wordpart.h and includes it in asm/word-at-a-time.h > for the all architectures. WORD_AT_A_TIME_CONSTANTS depends on kernel.h > because of REPEAT_BYTE. Moving this to another header and including it > where nece

Re: [PATCH v3 2/2] lib/string: shrink lib/string.i via IWYU

2023-12-19 Thread Andy Shevchenko
On Mon, Dec 18, 2023 at 06:44:48PM +, tanz...@google.com wrote: > This diff uses an open source tool include-what-you-use (IWYU) to modify > the include list changing indirect includes to direct includes. > IWYU is implemented using the IWYUScripts github repository which is a tool > that is >

Re: [PATCH v3 2/2] lib/string: shrink lib/string.i via IWYU

2023-12-19 Thread Nick Desaulniers
On Tue, Dec 19, 2023 at 7:55 AM Andy Shevchenko wrote: > > On Mon, Dec 18, 2023 at 06:44:48PM +, tanz...@google.com wrote: > > This diff uses an open source tool include-what-you-use (IWYU) to modify > > the include list changing indirect includes to direct includes. > > IWYU is implemented us

[PATCH v4 0/2] shrink lib/string.i via IWYU

2023-12-19 Thread Tanzir Hasan
This patch series changes the include list of string.c to minimize the preprocessing size. The patch series intends to remove REPEAT_BYE from kernel.h and move it into its own header file because word-at-a-time.h has an implicit dependancy on it but it is declared in kernel.h which is bloated. ---

[PATCH v4 1/2] kernel.h: removed REPEAT_BYTE from kernel.h

2023-12-19 Thread Tanzir Hasan
This patch creates wordpart.h and includes it in asm/word-at-a-time.h for the all architectures. WORD_AT_A_TIME_CONSTANTS depends on kernel.h because of REPEAT_BYTE. Moving this to another header and including it where necessary allows us to not include the bloated kernel.h. Making this implicit de

[PATCH v4 2/2] lib/string: shrink lib/string.i via IWYU

2023-12-19 Thread Tanzir Hasan
This diff uses an open source tool include-what-you-use (IWYU) to modify the include list changing indirect includes to direct includes. IWYU is implemented using the IWYUScripts github repository which is a tool that is currently undergoing development. These changes seek to improve build times.

Re: [PATCH v4 1/2] kernel.h: removed REPEAT_BYTE from kernel.h

2023-12-19 Thread Greg KH
On Tue, Dec 19, 2023 at 06:09:51PM +, Tanzir Hasan wrote: > --- a/include/linux/kernel.h > +++ b/include/linux/kernel.h > @@ -39,13 +39,6 @@ > > #define STACK_MAGIC 0xdeadbeef > > -/** > - * REPEAT_BYTE - repeat the value @x multiple times as an unsigned long value > - * @x: value to repe

Re: [PATCH v4 2/2] lib/string: shrink lib/string.i via IWYU

2023-12-19 Thread Greg KH
On Tue, Dec 19, 2023 at 06:09:52PM +, Tanzir Hasan wrote: > This diff uses an open source tool include-what-you-use (IWYU) to modify > the include list changing indirect includes to direct includes. > IWYU is implemented using the IWYUScripts github repository which is a tool > that is > curre

Re: [PATCH v4 1/2] kernel.h: removed REPEAT_BYTE from kernel.h

2023-12-19 Thread Tanzir Hasan
> Legal note, this file is NOT copyright Google as no Google employe > actually wrote the logcal contents of it. > > Please be VERY careful when doing stuff like this, it has potentially > big repercussions, and you don't want to have to talk to lots of > lawyers a few years from now and explain ho

[PATCH v5 0/2] shrink lib/string.i via IWYU

2023-12-19 Thread Tanzir Hasan
. --- --- Changes in v5: - Removed bad copyright. - Link to v4: https://lore.kernel.org/r/20231219-libstringheader-v4-0-aaeb26495...@google.com Changes in v4: - Fixed personal email client so name appears instead of just email - Removed kernel.h where not needed. - Sorted include list in lib/string.c

[PATCH v5 1/2] kernel.h: removed REPEAT_BYTE from kernel.h

2023-12-19 Thread Tanzir Hasan
This patch creates wordpart.h and includes it in asm/word-at-a-time.h for the all architectures. WORD_AT_A_TIME_CONSTANTS depends on kernel.h because of REPEAT_BYTE. Moving this to another header and including it where necessary allows us to not include the bloated kernel.h. Making this implicit de

[PATCH v5 2/2] lib/string: shrink lib/string.i via IWYU

2023-12-19 Thread Tanzir Hasan
This diff uses an open source tool include-what-you-use (IWYU) to modify the include list, changing indirect includes to direct includes. IWYU is implemented using the IWYUScripts github repository which is a tool that is currently undergoing development. These changes seek to improve build times.

Re: [PATCH v4 1/2] kernel.h: removed REPEAT_BYTE from kernel.h

2023-12-19 Thread Greg KH
On Tue, Dec 19, 2023 at 10:35:55AM -0800, Tanzir Hasan wrote: > > Legal note, this file is NOT copyright Google as no Google employe > > actually wrote the logcal contents of it. > > > > Please be VERY careful when doing stuff like this, it has potentially > > big repercussions, and you don't want

Re: [PATCH v2 00/18] sysctl: constify sysctl ctl_tables

2023-12-19 Thread Thomas Weißschuh
Hi Luis and Julia, (Julia, there is a question and context for you inline, marked with your name) On 2023-12-18 13:21:49-0800, Luis Chamberlain wrote: > So we can split this up concentually in two: > > * constificaiton of the table handlers > * constification of the table struct itself > > On

Re: [PATCH v2 00/18] sysctl: constify sysctl ctl_tables

2023-12-19 Thread Julia Lawall
On Tue, 19 Dec 2023, Thomas Weißschuh wrote: > Hi Luis and Julia, > > (Julia, there is a question and context for you inline, marked with your name) > > On 2023-12-18 13:21:49-0800, Luis Chamberlain wrote: > > So we can split this up concentually in two: > > > > * constificaiton of the table ha

Re: [PATCH v2 00/18] sysctl: constify sysctl ctl_tables

2023-12-19 Thread Luis Chamberlain
On Tue, Dec 19, 2023 at 08:29:50PM +0100, Thomas Weißschuh wrote: > > I used the following coccinelle script to find more handlers that I > missed before: > > virtual patch > virtual context > virtual report > > @@ > identifier func; > identifier ctl; > identifier write; > identifier buffer; > i

Re: [PATCH v2 00/18] sysctl: constify sysctl ctl_tables

2023-12-19 Thread Julia Lawall
> As I noted, I think this is a generically neat endeavor and so I think > it would be nice to shorthand *any* member of the struct. ctl->any. > Julia, is that possible? What do you mean by *any* member? If any is an identifier typed metavariable then that would get any immediate member. But may

[PATCH v4] iio: sx9324: avoid copying property strings

2023-12-19 Thread Justin Stitt
We're doing some needless string copies when trying to assign the proper `prop` string. We can make `prop` a const char* and simply assign to string literals. For the case where a format string is used, let's extract the parsing logic out into sx9324_parse_phase_prop(). We no longer need to create

Re: [PATCH v4 1/2] kernel.h: removed REPEAT_BYTE from kernel.h

2023-12-19 Thread Andy Shevchenko
On Tue, Dec 19, 2023 at 8:10 PM Tanzir Hasan wrote: > > This patch creates wordpart.h and includes it in asm/word-at-a-time.h > for the all architectures. WORD_AT_A_TIME_CONSTANTS depends on kernel.h for all ("all" doesn't go with article) > because of REPEAT_BYTE. Moving this to another header

Re: [PATCH v5 1/2] kernel.h: removed REPEAT_BYTE from kernel.h

2023-12-19 Thread Andy Shevchenko
On Tue, Dec 19, 2023 at 8:48 PM Tanzir Hasan wrote: > > This patch creates wordpart.h and includes it in asm/word-at-a-time.h > for the all architectures. WORD_AT_A_TIME_CONSTANTS depends on kernel.h > because of REPEAT_BYTE. Moving this to another header and including it > where necessary allows

Re: [PATCH v5 2/2] lib/string: shrink lib/string.i via IWYU

2023-12-19 Thread Andy Shevchenko
On Tue, Dec 19, 2023 at 8:48 PM Tanzir Hasan wrote: > > This diff uses an open source tool include-what-you-use (IWYU) to modify > the include list, changing indirect includes to direct includes. IWYU is > implemented using the IWYUScripts github repository which is a tool that > is currently unde

Re: [PATCH v4 1/2] kernel.h: removed REPEAT_BYTE from kernel.h

2023-12-19 Thread Nick Desaulniers
On Tue, Dec 19, 2023 at 11:10 AM Greg KH wrote: > > > > Legal note, this file is NOT copyright Google as no Google employe > > > actually wrote the logcal contents of it. > > > > > > Please be VERY careful when doing stuff like this, it has potentially > > > big repercussions, and you don't want t

Re: [PATCH v2 00/18] sysctl: constify sysctl ctl_tables

2023-12-19 Thread Julia Lawall
I came up with the following: @@ type t; const t *x; identifier y,z; expression a; assignment operator aop; @@ ( (<+...(<+...x->y...+>)[...]...+>) aop a | (<+...(<+...x->y...+>)->z...+>) aop a | * (<+...x->y...+>) aop a ) @fn disable optional_qualifier@ identifier f,x; type t; parameter list

Re: [PATCH v4] iio: sx9324: avoid copying property strings

2023-12-19 Thread Stephen Boyd
Quoting Justin Stitt (2023-12-19 13:34:15) > We're doing some needless string copies when trying to assign the proper > `prop` string. We can make `prop` a const char* and simply assign to > string literals. > > For the case where a format string is used, let's extract the parsing > logic out into

Re: [PATCH v2 00/18] sysctl: constify sysctl ctl_tables

2023-12-19 Thread Luis Chamberlain
On Tue, Dec 19, 2023 at 10:21:25PM +0100, Julia Lawall wrote: > > As I noted, I think this is a generically neat endeavor and so I think > > it would be nice to shorthand *any* member of the struct. ctl->any. > > Julia, is that possible? > > What do you mean by *any* member? I meant when any code

Re: [PATCH v4 1/2] kernel.h: removed REPEAT_BYTE from kernel.h

2023-12-19 Thread Greg KH
On Tue, Dec 19, 2023 at 03:00:22PM -0800, Nick Desaulniers wrote: > --- > > For Google specific guidance, I'll quote what they have: > > > License Headers and Copyright Notices > > Googlers should add Google's copyright notice (or a "The Project Authors" > > style copyright notice) to new files

Re: [PATCH v2 00/18] sysctl: constify sysctl ctl_tables

2023-12-19 Thread Julia Lawall
On Tue, 19 Dec 2023, Luis Chamberlain wrote: > On Tue, Dec 19, 2023 at 10:21:25PM +0100, Julia Lawall wrote: > > > As I noted, I think this is a generically neat endeavor and so I think > > > it would be nice to shorthand *any* member of the struct. ctl->any. > > > Julia, is that possible? > >