From: Olof Johansson <olof@lixom.net>
To: Michael Ellerman <michael@ellerman.id.au>
Cc: linuxppc-dev@ozlabs.org, Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH 8/11] powerpc: Add strne2a() to convert a string from EBCDIC to ASCII
Date: Tue, 21 Mar 2006 12:11:05 -0600 [thread overview]
Message-ID: <20060321181105.GA5248@pb15.lixom.net> (raw)
In-Reply-To: <20060321094637.C86EE67BBB@ozlabs.org>
On Tue, Mar 21, 2006 at 08:46:08PM +1100, Michael Ellerman wrote:
> Add strne2a() which converts a string from EBCDIC to ASCII.
Nitpick, since this isn't hot path:
>
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> ---
>
> arch/powerpc/lib/e2a.c | 10 ++++++++++
> include/asm-powerpc/system.h | 2 ++
> 2 files changed, 12 insertions(+)
>
> Index: to-merge/arch/powerpc/lib/e2a.c
> ===================================================================
> --- to-merge.orig/arch/powerpc/lib/e2a.c
> +++ to-merge/arch/powerpc/lib/e2a.c
> @@ -103,4 +103,14 @@ unsigned char e2a(unsigned char x)
> }
> EXPORT_SYMBOL(e2a);
>
> +unsigned char* strne2a(unsigned char *dest, const unsigned char *src, size_t n)
> +{
> + int i;
>
> + n = strnlen(src, n);
> +
> + for (i = 0; i < n; i++)
> + dest[i] = e2a(src[i]);
Why iterate over the string twice? Why not do
for (..; i < n && src[n]; ...)
instead?
-Olof
next prev parent reply other threads:[~2006-03-21 18:11 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-21 9:45 [PATCH 1/11] powerpc: Unconfuse htab_bolt_mapping() callers Michael Ellerman
2006-03-21 9:45 ` [PATCH 2/11] powerpc: Remove unused iommu_off logic from pSeries_init_early() Michael Ellerman
2006-03-21 16:15 ` Olof Johansson
2006-03-21 9:45 ` [PATCH 3/11] powerpc: trivial: Cleanup whitespace in cputable.h Michael Ellerman
2006-03-21 9:45 ` [PATCH 4/11] powerpc: Replace platform_is_lpar() with a firmware feature Michael Ellerman
2006-03-22 0:35 ` Stephen Rothwell
2006-03-22 0:48 ` Michael Ellerman
2006-03-21 9:46 ` [PATCH 5/11] powerpc: iseries: mf related cleanups Michael Ellerman
2006-03-22 0:39 ` Stephen Rothwell
2006-03-21 9:46 ` [PATCH 6/11] powerpc: iseries: Remove pointless iSeries_(restart|power_off|halt) Michael Ellerman
2006-03-21 9:46 ` [PATCH 7/11] powerpc: iseries: Make more stuff static in platforms/iseries/mf.c Michael Ellerman
2006-03-21 9:46 ` [PATCH 8/11] powerpc: Add strne2a() to convert a string from EBCDIC to ASCII Michael Ellerman
2006-03-21 18:11 ` Olof Johansson [this message]
2006-03-21 18:32 ` Andreas Schwab
2006-03-21 18:43 ` Olof Johansson
2006-03-21 23:25 ` Michael Ellerman
2006-03-21 9:46 ` [PATCH 9/11] powerpc: iseries: Add /system-id, /model and /compatible Michael Ellerman
2006-03-21 9:46 ` [PATCH 10/11] powerpc: iseries: Add bootargs to /chosen Michael Ellerman
2006-03-21 9:46 ` [PATCH 11/11] powerpc: Remove calculation of io hole Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060321181105.GA5248@pb15.lixom.net \
--to=olof@lixom.net \
--cc=linuxppc-dev@ozlabs.org \
--cc=michael@ellerman.id.au \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.