Re: [PATCH v2] MIPS: ZBOOT: gather string functions into string.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2013/9/29 Antony Pavlov <antonynpavlov@xxxxxxxxx>:
> 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@xxxxxxxxx>

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

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

[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


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux