linux-mips
[Top] [All Lists]

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

To: Antony Pavlov <antonynpavlov@gmail.com>
Subject: Re: [PATCH v2] MIPS: ZBOOT: gather string functions into string.c
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Mon, 30 Sep 2013 14:28:45 +0100
Cc: Linux-MIPS <linux-mips@linux-mips.org>, Ralf Baechle <ralf@linux-mips.org>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=BDOqQ0phJ6qFNTDSr9xclifv3at79osrzY+bHu8Zhic=; b=r5SMWYjVm0fmADIQN5I/NyuH8BgpgyH0e5F9tb17xtMjHbAmFqj6uZAp3SfOY0f2zL FjWgWLxzKg0DOCddhB/UvMbLs3vxvj4zGW+QwNRME93ojjTBiBvSgajOFBFbEvWe0DjH OSvC9FjBZvZ95KiPab1DkaFAFeND8vZIjPbgkJwTRGcE8MAIw97/bt5WpPs5Mqw5wDSc yGjJmxyYYP1sPSIqZwVuMk9rc2+1w0XGNMsxsliBkeT9cgTDkwD+A1bsi6kyOvJWXV4c c4PrD0tvwllEvsCJbJOPSVUpzNhTLLlHLIItnTeoEpH9q2zw7S0LaCG03bBTU1OHU9yB x5fA==
In-reply-to: <1380472330-9247-1-git-send-email-antonynpavlov@gmail.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1380472330-9247-1-git-send-email-antonynpavlov@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
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 Thread] Current Thread [Next in Thread>