Re: [PATCH 1/2] string: implement strchrnul

2021-06-20 Thread Ahmad Fatoum
Hi, On 21.06.21 06:52, Sascha Hauer wrote: > Hi Ahmad, > > On Sat, Jun 19, 2021 at 05:26:53AM +0200, Ahmad Fatoum wrote: >> -} >> - >> static int sscanf_two_digits(char *s, int *res) >> { >> char buf[3]; >> diff --git a/drivers/of/base.c b/drivers/of/base.c >> index

Re: [PATCH 1/2] string: implement strchrnul

2021-06-20 Thread Sascha Hauer
Hi Ahmad, On Sat, Jun 19, 2021 at 05:26:53AM +0200, Ahmad Fatoum wrote: > -} > - > static int sscanf_two_digits(char *s, int *res) > { > char buf[3]; > diff --git a/drivers/of/base.c b/drivers/of/base.c > index 6e716fcdcf27..f375fcd67572 100644 > --- a/drivers/of/base.c > +++

[PATCH 1/2] string: implement strchrnul

2021-06-18 Thread Ahmad Fatoum
We have at least two places opencoding strchrnul, one of them needlessly iterating twice instead of once over the string. Replace both by calling a single pass implementation. Signed-off-by: Ahmad Fatoum --- commands/hwclock.c | 8 drivers/of/base.c | 5 +