diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2006-07-13 03:52:04 -0400 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2006-07-13 04:42:03 -0400 |
commit | dac411e7aa92d23dadbcb8721845ab88577294c7 (patch) | |
tree | 38cca1b9999c44db1ebf1aea53879a2130f85c7f | |
parent | a749690ecf7ab55aa46df1698bcee3ec110612df (diff) |
[POWERPC] iseries: Move e2a()/strne2a() into their only caller
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>
-rw-r--r-- | arch/powerpc/lib/Makefile | 1 | ||||
-rw-r--r-- | arch/powerpc/lib/e2a.c | 116 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/dt.c | 98 | ||||
-rw-r--r-- | include/asm-powerpc/system.h | 5 |
4 files changed, 97 insertions, 123 deletions
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile index ff7096458249..336dd191f768 100644 --- a/arch/powerpc/lib/Makefile +++ b/arch/powerpc/lib/Makefile | |||
@@ -14,7 +14,6 @@ endif | |||
14 | obj-$(CONFIG_PPC64) += checksum_64.o copypage_64.o copyuser_64.o \ | 14 | obj-$(CONFIG_PPC64) += checksum_64.o copypage_64.o copyuser_64.o \ |
15 | memcpy_64.o usercopy_64.o mem_64.o string.o \ | 15 | memcpy_64.o usercopy_64.o mem_64.o string.o \ |
16 | strcase.o | 16 | strcase.o |
17 | obj-$(CONFIG_PPC_ISERIES) += e2a.o | ||
18 | obj-$(CONFIG_XMON) += sstep.o | 17 | obj-$(CONFIG_XMON) += sstep.o |
19 | 18 | ||
20 | ifeq ($(CONFIG_PPC64),y) | 19 | ifeq ($(CONFIG_PPC64),y) |
diff --git a/arch/powerpc/lib/e2a.c b/arch/powerpc/lib/e2a.c deleted file mode 100644 index 4b72ed8fd50e..000000000000 --- a/arch/powerpc/lib/e2a.c +++ /dev/null | |||
@@ -1,116 +0,0 @@ | |||
1 | /* | ||
2 | * EBCDIC to ASCII conversion | ||
3 | * | ||
4 | * This function moved here from arch/powerpc/platforms/iseries/viopath.c | ||
5 | * | ||
6 | * (C) Copyright 2000-2004 IBM Corporation | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License as | ||
10 | * published by the Free Software Foundation; either version 2 of the | ||
11 | * License, or (at your option) anyu later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, but | ||
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | * General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software Foundation, | ||
20 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #include <linux/module.h> | ||
25 | |||
26 | unsigned char e2a(unsigned char x) | ||
27 | { | ||
28 | switch (x) { | ||
29 | case 0xF0: | ||
30 | return '0'; | ||
31 | case 0xF1: | ||
32 | return '1'; | ||
33 | case 0xF2: | ||
34 | return '2'; | ||
35 | case 0xF3: | ||
36 | return '3'; | ||
37 | case 0xF4: | ||
38 | return '4'; | ||
39 | case 0xF5: | ||
40 | return '5'; | ||
41 | case 0xF6: | ||
42 | return '6'; | ||
43 | case 0xF7: | ||
44 | return '7'; | ||
45 | case 0xF8: | ||
46 | return '8'; | ||
47 | case 0xF9: | ||
48 | return '9'; | ||
49 | case 0xC1: | ||
50 | return 'A'; | ||
51 | case 0xC2: | ||
52 | return 'B'; | ||
53 | case 0xC3: | ||
54 | return 'C'; | ||
55 | case 0xC4: | ||
56 | return 'D'; | ||
57 | case 0xC5: | ||
58 | return 'E'; | ||
59 | case 0xC6: | ||
60 | return 'F'; | ||
61 | case 0xC7: | ||
62 | return 'G'; | ||
63 | case 0xC8: | ||
64 | return 'H'; | ||
65 | case 0xC9: | ||
66 | return 'I'; | ||
67 | case 0xD1: | ||
68 | return 'J'; | ||
69 | case 0xD2: | ||
70 | return 'K'; | ||
71 | case 0xD3: | ||
72 | return 'L'; | ||
73 | case 0xD4: | ||
74 | return 'M'; | ||
75 | case 0xD5: | ||
76 | return 'N'; | ||
77 | case 0xD6: | ||
78 | return 'O'; | ||
79 | case 0xD7: | ||
80 | return 'P'; | ||
81 | case 0xD8: | ||
82 | return 'Q'; | ||
83 | case 0xD9: | ||
84 | return 'R'; | ||
85 | case 0xE2: | ||
86 | return 'S'; | ||
87 | case 0xE3: | ||
88 | return 'T'; | ||
89 | case 0xE4: | ||
90 | return 'U'; | ||
91 | case 0xE5: | ||
92 | return 'V'; | ||
93 | case 0xE6: | ||
94 | return 'W'; | ||
95 | case 0xE7: | ||
96 | return 'X'; | ||
97 | case 0xE8: | ||
98 | return 'Y'; | ||
99 | case 0xE9: | ||
100 | return 'Z'; | ||
101 | } | ||
102 | return ' '; | ||
103 | } | ||
104 | EXPORT_SYMBOL(e2a); | ||
105 | |||
106 | unsigned char* strne2a(unsigned char *dest, const unsigned char *src, size_t n) | ||
107 | { | ||
108 | int i; | ||
109 | |||
110 | n = strnlen(src, n); | ||
111 | |||
112 | for (i = 0; i < n; i++) | ||
113 | dest[i] = e2a(src[i]); | ||
114 | |||
115 | return dest; | ||
116 | } | ||
diff --git a/arch/powerpc/platforms/iseries/dt.c b/arch/powerpc/platforms/iseries/dt.c index d194140c1ebf..39c676ab9d6d 100644 --- a/arch/powerpc/platforms/iseries/dt.c +++ b/arch/powerpc/platforms/iseries/dt.c | |||
@@ -1,5 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2005-2006 Michael Ellerman, IBM Corporation | 2 | * Copyright (C) 2005-2006 Michael Ellerman, IBM Corporation |
3 | * Copyright (C) 2000-2004, IBM Corporation | ||
3 | * | 4 | * |
4 | * Description: | 5 | * Description: |
5 | * This file contains all the routines to build a flattened device | 6 | * This file contains all the routines to build a flattened device |
@@ -76,6 +77,101 @@ static char __initdata device_type_pci[] = "pci"; | |||
76 | static char __initdata device_type_vdevice[] = "vdevice"; | 77 | static char __initdata device_type_vdevice[] = "vdevice"; |
77 | static char __initdata device_type_vscsi[] = "vscsi"; | 78 | static char __initdata device_type_vscsi[] = "vscsi"; |
78 | 79 | ||
80 | |||
81 | /* EBCDIC to ASCII conversion routines */ | ||
82 | |||
83 | unsigned char e2a(unsigned char x) | ||
84 | { | ||
85 | switch (x) { | ||
86 | case 0xF0: | ||
87 | return '0'; | ||
88 | case 0xF1: | ||
89 | return '1'; | ||
90 | case 0xF2: | ||
91 | return '2'; | ||
92 | case 0xF3: | ||
93 | return '3'; | ||
94 | case 0xF4: | ||
95 | return '4'; | ||
96 | case 0xF5: | ||
97 | return '5'; | ||
98 | case 0xF6: | ||
99 | return '6'; | ||
100 | case 0xF7: | ||
101 | return '7'; | ||
102 | case 0xF8: | ||
103 | return '8'; | ||
104 | case 0xF9: | ||
105 | return '9'; | ||
106 | case 0xC1: | ||
107 | return 'A'; | ||
108 | case 0xC2: | ||
109 | return 'B'; | ||
110 | case 0xC3: | ||
111 | return 'C'; | ||
112 | case 0xC4: | ||
113 | return 'D'; | ||
114 | case 0xC5: | ||
115 | return 'E'; | ||
116 | case 0xC6: | ||
117 | return 'F'; | ||
118 | case 0xC7: | ||
119 | return 'G'; | ||
120 | case 0xC8: | ||
121 | return 'H'; | ||
122 | case 0xC9: | ||
123 | return 'I'; | ||
124 | case 0xD1: | ||
125 | return 'J'; | ||
126 | case 0xD2: | ||
127 | return 'K'; | ||
128 | case 0xD3: | ||
129 | return 'L'; | ||
130 | case 0xD4: | ||
131 | return 'M'; | ||
132 | case 0xD5: | ||
133 | return 'N'; | ||
134 | case 0xD6: | ||
135 | return 'O'; | ||
136 | case 0xD7: | ||
137 | return 'P'; | ||
138 | case 0xD8: | ||
139 | return 'Q'; | ||
140 | case 0xD9: | ||
141 | return 'R'; | ||
142 | case 0xE2: | ||
143 | return 'S'; | ||
144 | case 0xE3: | ||
145 | return 'T'; | ||
146 | case 0xE4: | ||
147 | return 'U'; | ||
148 | case 0xE5: | ||
149 | return 'V'; | ||
150 | case 0xE6: | ||
151 | return 'W'; | ||
152 | case 0xE7: | ||
153 | return 'X'; | ||
154 | case 0xE8: | ||
155 | return 'Y'; | ||
156 | case 0xE9: | ||
157 | return 'Z'; | ||
158 | } | ||
159 | return ' '; | ||
160 | } | ||
161 | EXPORT_SYMBOL(e2a); | ||
162 | |||
163 | unsigned char* strne2a(unsigned char *dest, const unsigned char *src, size_t n) | ||
164 | { | ||
165 | int i; | ||
166 | |||
167 | n = strnlen(src, n); | ||
168 | |||
169 | for (i = 0; i < n; i++) | ||
170 | dest[i] = e2a(src[i]); | ||
171 | |||
172 | return dest; | ||
173 | } | ||
174 | |||
79 | static struct iseries_flat_dt * __init dt_init(void) | 175 | static struct iseries_flat_dt * __init dt_init(void) |
80 | { | 176 | { |
81 | struct iseries_flat_dt *dt; | 177 | struct iseries_flat_dt *dt; |
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h index d075725bf444..5deb7bc7bb1f 100644 --- a/include/asm-powerpc/system.h +++ b/include/asm-powerpc/system.h | |||
@@ -169,11 +169,6 @@ extern u32 booke_wdt_enabled; | |||
169 | extern u32 booke_wdt_period; | 169 | extern u32 booke_wdt_period; |
170 | #endif /* CONFIG_BOOKE_WDT */ | 170 | #endif /* CONFIG_BOOKE_WDT */ |
171 | 171 | ||
172 | /* EBCDIC -> ASCII conversion for [0-9A-Z] on iSeries */ | ||
173 | extern unsigned char e2a(unsigned char); | ||
174 | extern unsigned char* strne2a(unsigned char *dest, | ||
175 | const unsigned char *src, size_t n); | ||
176 | |||
177 | struct device_node; | 172 | struct device_node; |
178 | extern void note_scsi_host(struct device_node *, void *); | 173 | extern void note_scsi_host(struct device_node *, void *); |
179 | 174 | ||