Commit 584fc6d1 authored by Michael Ellerman's avatar Michael Ellerman Committed by Paul Mackerras

[PATCH] powerpc: Add strne2a() to convert a string from EBCDIC to ASCII

Add strne2a() which converts a string from EBCDIC to ASCII.
Signed-off-by: default avatarMichael Ellerman <michael@ellerman.id.au>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 00611c5c
...@@ -103,4 +103,14 @@ unsigned char e2a(unsigned char x) ...@@ -103,4 +103,14 @@ unsigned char e2a(unsigned char x)
} }
EXPORT_SYMBOL(e2a); 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]);
return dest;
}
...@@ -171,6 +171,8 @@ extern u32 booke_wdt_period; ...@@ -171,6 +171,8 @@ extern u32 booke_wdt_period;
/* EBCDIC -> ASCII conversion for [0-9A-Z] on iSeries */ /* EBCDIC -> ASCII conversion for [0-9A-Z] on iSeries */
extern unsigned char e2a(unsigned char); extern unsigned char e2a(unsigned char);
extern unsigned char* strne2a(unsigned char *dest,
const unsigned char *src, size_t n);
struct device_node; struct device_node;
extern void note_scsi_host(struct device_node *, void *); extern void note_scsi_host(struct device_node *, void *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment