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
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
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')
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 */;
> -
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