Re: [RFC PATCH v1 07/12] efi: Replace strstarts() by str_has_prefix().

2020-12-11 Thread Arvind Sankar
On Fri, Dec 11, 2020 at 09:45:15AM +, David Laight wrote: > From: Arvind Sankar > > Sent: 10 December 2020 18:14 > ... > > I wasn't aware of str_has_prefix() at the time. It does seem useful to > > eliminate the duplication of the string literal, I like the > > skip_prefix() API suggestion, may

RE: [RFC PATCH v1 07/12] efi: Replace strstarts() by str_has_prefix().

2020-12-11 Thread David Laight
From: Arvind Sankar > Sent: 10 December 2020 18:14 ... > I wasn't aware of str_has_prefix() at the time. It does seem useful to > eliminate the duplication of the string literal, I like the > skip_prefix() API suggestion, maybe even > > bool str_skip_prefix(const char **s, const char *pfx) >

Re: [RFC PATCH v1 07/12] efi: Replace strstarts() by str_has_prefix().

2020-12-10 Thread Arvind Sankar
On Sat, Dec 05, 2020 at 08:36:02PM +0100, Ard Biesheuvel wrote: > On Fri, 4 Dec 2020 at 19:02, James Bottomley > wrote: > > > > On Fri, 2020-12-04 at 18:07 +0100, Ard Biesheuvel wrote: > > > On Fri, 4 Dec 2020 at 18:06, > > > wrote: > > > > From: Francis Laniel > > > > > > > > The two functions

RE: [RFC PATCH v1 07/12] efi: Replace strstarts() by str_has_prefix().

2020-12-07 Thread David Laight
From: Steven Rostedt > Sent: 07 December 2020 15:10 > > On Sat, 05 Dec 2020 15:04:31 -0800 > James Bottomley wrote: > > > Well, I think the pattern > > > > if (strstarts(option, )) { > >... > >option += strlen(); > > > > is a bad one because one day may get updated but not > string>.

Re: [RFC PATCH v1 07/12] efi: Replace strstarts() by str_has_prefix().

2020-12-07 Thread Steven Rostedt
On Sat, 05 Dec 2020 15:04:31 -0800 James Bottomley wrote: > Well, I think the pattern > > if (strstarts(option, )) { >... >option += strlen(); > > is a bad one because one day may get updated but not string>. And if is too far away in the code it might not > even show up in the di

Re: [RFC PATCH v1 07/12] efi: Replace strstarts() by str_has_prefix().

2020-12-05 Thread James Bottomley
On Sat, 2020-12-05 at 22:20 +0100, Ard Biesheuvel wrote: > On Sat, 5 Dec 2020 at 22:15, James Bottomley > wrote: > > [Rostedt added because this is all his fault] > > On Sat, 2020-12-05 at 21:57 +0100, Ard Biesheuvel wrote: > > > On Sat, 5 Dec 2020 at 21:24, James Bottomley > > > wrote: > > [...]

Re: [RFC PATCH v1 07/12] efi: Replace strstarts() by str_has_prefix().

2020-12-05 Thread Ard Biesheuvel
On Sat, 5 Dec 2020 at 22:15, James Bottomley wrote: > > [Rostedt added because this is all his fault] > On Sat, 2020-12-05 at 21:57 +0100, Ard Biesheuvel wrote: > > On Sat, 5 Dec 2020 at 21:24, James Bottomley > > wrote: > [...] > > > > So I don't object to using str_has_prefix() in new code in t

Re: [RFC PATCH v1 07/12] efi: Replace strstarts() by str_has_prefix().

2020-12-05 Thread James Bottomley
[Rostedt added because this is all his fault] On Sat, 2020-12-05 at 21:57 +0100, Ard Biesheuvel wrote: > On Sat, 5 Dec 2020 at 21:24, James Bottomley > wrote: [...] > > > So I don't object to using str_has_prefix() in new code in this > > > way, but I really don't see the point of touching existin

Re: [RFC PATCH v1 07/12] efi: Replace strstarts() by str_has_prefix().

2020-12-05 Thread Ard Biesheuvel
On Sat, 5 Dec 2020 at 21:24, James Bottomley wrote: > > On Sat, 2020-12-05 at 20:36 +0100, Ard Biesheuvel wrote: > > On Fri, 4 Dec 2020 at 19:02, James Bottomley > > wrote: > > > On Fri, 2020-12-04 at 18:07 +0100, Ard Biesheuvel wrote: > > > > On Fri, 4 Dec 2020 at 18:06, > > > > wrote: > > > >

Re: [RFC PATCH v1 07/12] efi: Replace strstarts() by str_has_prefix().

2020-12-05 Thread Rasmus Villemoes
On 05/12/2020 20.36, Ard Biesheuvel wrote: > On Fri, 4 Dec 2020 at 19:02, James Bottomley > wrote: >> >> On Fri, 2020-12-04 at 18:07 +0100, Ard Biesheuvel wrote: >>> On Fri, 4 Dec 2020 at 18:06, >>> wrote: From: Francis Laniel The two functions indicates if a string begins with a

Re: [RFC PATCH v1 07/12] efi: Replace strstarts() by str_has_prefix().

2020-12-05 Thread James Bottomley
On Sat, 2020-12-05 at 20:36 +0100, Ard Biesheuvel wrote: > On Fri, 4 Dec 2020 at 19:02, James Bottomley > wrote: > > On Fri, 2020-12-04 at 18:07 +0100, Ard Biesheuvel wrote: > > > On Fri, 4 Dec 2020 at 18:06, > > > wrote: > > > > From: Francis Laniel > > > > > > > > The two functions indicates

Re: [RFC PATCH v1 07/12] efi: Replace strstarts() by str_has_prefix().

2020-12-05 Thread Ard Biesheuvel
On Fri, 4 Dec 2020 at 19:02, James Bottomley wrote: > > On Fri, 2020-12-04 at 18:07 +0100, Ard Biesheuvel wrote: > > On Fri, 4 Dec 2020 at 18:06, > > wrote: > > > From: Francis Laniel > > > > > > The two functions indicates if a string begins with a given prefix. > > > The only difference is tha

Re: [RFC PATCH v1 07/12] efi: Replace strstarts() by str_has_prefix().

2020-12-05 Thread Francis Laniel
Le vendredi 4 décembre 2020, 19:02:09 CET James Bottomley a écrit : > On Fri, 2020-12-04 at 18:07 +0100, Ard Biesheuvel wrote: > > On Fri, 4 Dec 2020 at 18:06, > > > > wrote: > > > From: Francis Laniel > > > > > > The two functions indicates if a string begins with a given prefix. > > > The onl

Re: [RFC PATCH v1 07/12] efi: Replace strstarts() by str_has_prefix().

2020-12-04 Thread James Bottomley
On Fri, 2020-12-04 at 18:07 +0100, Ard Biesheuvel wrote: > On Fri, 4 Dec 2020 at 18:06, > wrote: > > From: Francis Laniel > > > > The two functions indicates if a string begins with a given prefix. > > The only difference is that strstarts() returns a bool while > > str_has_prefix() > > returns

Re: [RFC PATCH v1 07/12] efi: Replace strstarts() by str_has_prefix().

2020-12-04 Thread Francis Laniel
Le vendredi 4 décembre 2020, 18:07:11 CET Ard Biesheuvel a écrit : > On Fri, 4 Dec 2020 at 18:06, wrote: > > From: Francis Laniel > > > > The two functions indicates if a string begins with a given prefix. > > The only difference is that strstarts() returns a bool while > > str_has_prefix() retu

Re: [RFC PATCH v1 07/12] efi: Replace strstarts() by str_has_prefix().

2020-12-04 Thread Ard Biesheuvel
On Fri, 4 Dec 2020 at 18:06, wrote: > > From: Francis Laniel > > The two functions indicates if a string begins with a given prefix. > The only difference is that strstarts() returns a bool while str_has_prefix() > returns the length of the prefix if the string begins with it or 0 otherwise. > W

[RFC PATCH v1 07/12] efi: Replace strstarts() by str_has_prefix().

2020-12-04 Thread laniel_francis
From: Francis Laniel The two functions indicates if a string begins with a given prefix. The only difference is that strstarts() returns a bool while str_has_prefix() returns the length of the prefix if the string begins with it or 0 otherwise. Signed-off-by: Francis Laniel --- drivers/firmwar