Re: [PATCH 1/2] powerpc/prom_init: Convert prom_strcpy() into prom_strscpy_pad()

2021-06-24 Thread Michael Ellerman
On Mon, 21 Jun 2021 16:49:37 +1000, Michael Ellerman wrote: > In a subsequent patch we'd like to have something like a strscpy_pad() > implementation usable in prom_init.c. > > Currently we have a strcpy() implementation with only one caller, so > convert it into strscpy_pad() and update the calle

Re: [PATCH 1/2] powerpc/prom_init: Convert prom_strcpy() into prom_strscpy_pad()

2021-06-22 Thread Tyrel Datwyler
On 6/21/21 9:11 PM, Michael Ellerman wrote: > Daniel Axtens writes: >> Hi >> >>> -static char __init *prom_strcpy(char *dest, const char *src) >>> +static ssize_t __init prom_strscpy_pad(char *dest, const char *src, size_t >>> n) >>> { >>> - char *tmp = dest; >>> + ssize_t rc; >>> + size_t

Re: [PATCH 1/2] powerpc/prom_init: Convert prom_strcpy() into prom_strscpy_pad()

2021-06-21 Thread Michael Ellerman
Daniel Axtens writes: > Hi > >> -static char __init *prom_strcpy(char *dest, const char *src) >> +static ssize_t __init prom_strscpy_pad(char *dest, const char *src, size_t >> n) >> { >> -char *tmp = dest; >> +ssize_t rc; >> +size_t i; >> >> -while ((*dest++ = *src++) != '\0')

Re: [PATCH 1/2] powerpc/prom_init: Convert prom_strcpy() into prom_strscpy_pad()

2021-06-21 Thread Daniel Axtens
Hi > -static char __init *prom_strcpy(char *dest, const char *src) > +static ssize_t __init prom_strscpy_pad(char *dest, const char *src, size_t n) > { > - char *tmp = dest; > + ssize_t rc; > + size_t i; > > - while ((*dest++ = *src++) != '\0') > - /* nothing */; > -

[PATCH 1/2] powerpc/prom_init: Convert prom_strcpy() into prom_strscpy_pad()

2021-06-20 Thread Michael Ellerman
In a subsequent patch we'd like to have something like a strscpy_pad() implementation usable in prom_init.c. Currently we have a strcpy() implementation with only one caller, so convert it into strscpy_pad() and update the caller. Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/prom_ini