Skip to content

Commit

Permalink
[POWERPC] iseries: Move e2a()/strne2a() into their only caller
Browse files Browse the repository at this point in the history
The ASCII -> EBCDIC functions, e2a() and strne2a() are now only used in
dt.c, so move them in there.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
  • Loading branch information
Michael Ellerman authored and Stephen Rothwell committed Jul 13, 2006
1 parent a749690 commit dac411e
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 123 deletions.
1 change: 0 additions & 1 deletion arch/powerpc/lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ endif
obj-$(CONFIG_PPC64) += checksum_64.o copypage_64.o copyuser_64.o \
memcpy_64.o usercopy_64.o mem_64.o string.o \
strcase.o
obj-$(CONFIG_PPC_ISERIES) += e2a.o
obj-$(CONFIG_XMON) += sstep.o

ifeq ($(CONFIG_PPC64),y)
Expand Down
116 changes: 0 additions & 116 deletions arch/powerpc/lib/e2a.c

This file was deleted.

98 changes: 97 additions & 1 deletion arch/powerpc/platforms/iseries/dt.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2005-2006 Michael Ellerman, IBM Corporation
* Copyright (C) 2005-2006 Michael Ellerman, IBM Corporation
* Copyright (C) 2000-2004, IBM Corporation
*
* Description:
* This file contains all the routines to build a flattened device
Expand Down Expand Up @@ -76,6 +77,101 @@ static char __initdata device_type_pci[] = "pci";
static char __initdata device_type_vdevice[] = "vdevice";
static char __initdata device_type_vscsi[] = "vscsi";


/* EBCDIC to ASCII conversion routines */

unsigned char e2a(unsigned char x)
{
switch (x) {
case 0xF0:
return '0';
case 0xF1:
return '1';
case 0xF2:
return '2';
case 0xF3:
return '3';
case 0xF4:
return '4';
case 0xF5:
return '5';
case 0xF6:
return '6';
case 0xF7:
return '7';
case 0xF8:
return '8';
case 0xF9:
return '9';
case 0xC1:
return 'A';
case 0xC2:
return 'B';
case 0xC3:
return 'C';
case 0xC4:
return 'D';
case 0xC5:
return 'E';
case 0xC6:
return 'F';
case 0xC7:
return 'G';
case 0xC8:
return 'H';
case 0xC9:
return 'I';
case 0xD1:
return 'J';
case 0xD2:
return 'K';
case 0xD3:
return 'L';
case 0xD4:
return 'M';
case 0xD5:
return 'N';
case 0xD6:
return 'O';
case 0xD7:
return 'P';
case 0xD8:
return 'Q';
case 0xD9:
return 'R';
case 0xE2:
return 'S';
case 0xE3:
return 'T';
case 0xE4:
return 'U';
case 0xE5:
return 'V';
case 0xE6:
return 'W';
case 0xE7:
return 'X';
case 0xE8:
return 'Y';
case 0xE9:
return 'Z';
}
return ' ';
}
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;
}

static struct iseries_flat_dt * __init dt_init(void)
{
struct iseries_flat_dt *dt;
Expand Down
5 changes: 0 additions & 5 deletions include/asm-powerpc/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,6 @@ extern u32 booke_wdt_enabled;
extern u32 booke_wdt_period;
#endif /* CONFIG_BOOKE_WDT */

/* EBCDIC -> ASCII conversion for [0-9A-Z] on iSeries */
extern unsigned char e2a(unsigned char);
extern unsigned char* strne2a(unsigned char *dest,
const unsigned char *src, size_t n);

struct device_node;
extern void note_scsi_host(struct device_node *, void *);

Expand Down

0 comments on commit dac411e

Please sign in to comment.