[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-mips
Subject:    Re: [PATCH v2] MIPS: ZBOOT: gather string functions into string.c
From:       Florian Fainelli <f.fainelli () gmail ! com>
Date:       2013-09-30 13:28:45
Message-ID: CAGVrzcZ2DoL6M9O9bFOWYaVQMawiJrdoL7HC1UUfbhxb3Mrvew () mail ! gmail ! com
[Download RAW message or body]

2013/9/29 Antony Pavlov <antonynpavlov@gmail.com>:
> In the worst case this adds less then 128 bytes of code
> but on the other hand this makes code organization more clear.
>
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>

Just one minor comment below, but not a big problem.

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

[snip]

> +/*
> + * arch/mips/boot/compressed/string.c
> + *
> + * Very small subset of simple string routines
> + */
> +
> +#include <linux/string.h>

Nitpick: only linux/types.h is actually required for size_t, but this
is not a big deal.

> +
> +void *memcpy(void *dest, const void *src, size_t n)
> +{
> +       int i;
> +       const char *s = src;
> +       char *d = dest;
> +
> +       for (i = 0; i < n; i++)
> +               d[i] = s[i];
> +       return dest;
> +}
> +
> +void *memset(void *s, int c, size_t n)
> +{
> +       int i;
> +       char *ss = s;
> +
> +       for (i = 0; i < n; i++)
> +               ss[i] = c;
> +       return s;
> +}
> --
> 1.8.4.rc3
>



-- 
Florian

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic