Re: [PATCH] fs: Cleanup string initializations (char[] instead of char *)

2014-05-18 Thread Kevin Easton
On Sat, May 17, 2014 at 05:53:45PM +0100, Al Viro wrote: > On Sat, May 17, 2014 at 05:00:18PM +0200, Manuel Sch?lling wrote: > > Initializations like 'char *foo = "bar"' will create two variables: a static > > string and a pointer (foo) to that static string. Instead 'char foo[] = > > "bar"' > >

Re: [PATCH] fs: Cleanup string initializations (char[] instead of char *)

2014-05-18 Thread Manuel Schoelling
Thanks for the detailed review of my patches, guys! I had a look at the assembler code now, too and you are right about this. I was misguided by the KernelJanitor's TODO list [1]. If there is consensus the corresponding paragraph from that list should be removed. [1]

Re: [PATCH] fs: Cleanup string initializations (char[] instead of char *)

2014-05-18 Thread Manuel Schoelling
Thanks for the detailed review of my patches, guys! I had a look at the assembler code now, too and you are right about this. I was misguided by the KernelJanitor's TODO list [1]. If there is consensus the corresponding paragraph from that list should be removed. [1]

Re: [PATCH] fs: Cleanup string initializations (char[] instead of char *)

2014-05-18 Thread Kevin Easton
On Sat, May 17, 2014 at 05:53:45PM +0100, Al Viro wrote: On Sat, May 17, 2014 at 05:00:18PM +0200, Manuel Sch?lling wrote: Initializations like 'char *foo = bar' will create two variables: a static string and a pointer (foo) to that static string. Instead 'char foo[] = bar' will declare

Re: [PATCH] fs: Cleanup string initializations (char[] instead of char *)

2014-05-17 Thread Mateusz Guzik
On Sat, May 17, 2014 at 06:21:09PM +0100, Al Viro wrote: > On Sat, May 17, 2014 at 05:44:28PM +0200, Mateusz Guzik wrote: > > This particular function would be better of with removing this variable > > and replacing all pairs like: > > sprintf(dp, ...); > > dp += strlen(...) > > > > with: > > dp

Re: [PATCH] fs: Cleanup string initializations (char[] instead of char *)

2014-05-17 Thread Al Viro
On Sat, May 17, 2014 at 05:44:28PM +0200, Mateusz Guzik wrote: > On Sat, May 17, 2014 at 05:00:18PM +0200, Manuel Schölling wrote: > > Initializations like 'char *foo = "bar"' will create two variables: a static > > string and a pointer (foo) to that static string. Instead 'char foo[] = > >

Re: [PATCH] fs: Cleanup string initializations (char[] instead of char *)

2014-05-17 Thread Al Viro
On Sat, May 17, 2014 at 05:00:18PM +0200, Manuel Schölling wrote: > Initializations like 'char *foo = "bar"' will create two variables: a static > string and a pointer (foo) to that static string. Instead 'char foo[] = "bar"' > will declare a single variable and will end up in shorter > assembly

Re: [PATCH] fs: Cleanup string initializations (char[] instead of char *)

2014-05-17 Thread Mateusz Guzik
On Sat, May 17, 2014 at 05:00:18PM +0200, Manuel Schölling wrote: > Initializations like 'char *foo = "bar"' will create two variables: a static > string and a pointer (foo) to that static string. Instead 'char foo[] = "bar"' > will declare a single variable and will end up in shorter > assembly

[PATCH] fs: Cleanup string initializations (char[] instead of char *)

2014-05-17 Thread Manuel Schölling
Initializations like 'char *foo = "bar"' will create two variables: a static string and a pointer (foo) to that static string. Instead 'char foo[] = "bar"' will declare a single variable and will end up in shorter assembly (according to Jeff Garzik on the KernelJanitor's TODO list).

[PATCH] fs: Cleanup string initializations (char[] instead of char *)

2014-05-17 Thread Manuel Schölling
Initializations like 'char *foo = bar' will create two variables: a static string and a pointer (foo) to that static string. Instead 'char foo[] = bar' will declare a single variable and will end up in shorter assembly (according to Jeff Garzik on the KernelJanitor's TODO list). Signed-off-by:

Re: [PATCH] fs: Cleanup string initializations (char[] instead of char *)

2014-05-17 Thread Mateusz Guzik
On Sat, May 17, 2014 at 05:00:18PM +0200, Manuel Schölling wrote: Initializations like 'char *foo = bar' will create two variables: a static string and a pointer (foo) to that static string. Instead 'char foo[] = bar' will declare a single variable and will end up in shorter assembly

Re: [PATCH] fs: Cleanup string initializations (char[] instead of char *)

2014-05-17 Thread Al Viro
On Sat, May 17, 2014 at 05:00:18PM +0200, Manuel Schölling wrote: Initializations like 'char *foo = bar' will create two variables: a static string and a pointer (foo) to that static string. Instead 'char foo[] = bar' will declare a single variable and will end up in shorter assembly

Re: [PATCH] fs: Cleanup string initializations (char[] instead of char *)

2014-05-17 Thread Al Viro
On Sat, May 17, 2014 at 05:44:28PM +0200, Mateusz Guzik wrote: On Sat, May 17, 2014 at 05:00:18PM +0200, Manuel Schölling wrote: Initializations like 'char *foo = bar' will create two variables: a static string and a pointer (foo) to that static string. Instead 'char foo[] = bar' will

Re: [PATCH] fs: Cleanup string initializations (char[] instead of char *)

2014-05-17 Thread Mateusz Guzik
On Sat, May 17, 2014 at 06:21:09PM +0100, Al Viro wrote: On Sat, May 17, 2014 at 05:44:28PM +0200, Mateusz Guzik wrote: This particular function would be better of with removing this variable and replacing all pairs like: sprintf(dp, ...); dp += strlen(...) with: dp += sprintf(dp,