aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/iseries
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2006-07-13 03:52:06 -0400
committerStephen Rothwell <sfr@canb.auug.org.au>2006-07-13 04:42:20 -0400
commita892e5d7fa7fb893b5873f7150a83f6f1ee141b5 (patch)
tree7bf5194235b14ffc837ed38db7110d01eb7a6089 /arch/powerpc/platforms/iseries
parentdac411e7aa92d23dadbcb8721845ab88577294c7 (diff)
[POWERPC] iseries: Cleanup e2a() and strne2a()
e2a() was formally used by lparcfg, and so had to be exported, but isn't anymore, so don't. e2a() and strne2a() can both be static, and __init. And e2a can be made much more concise if we use x ... y case labels, while we're there add support for lower case letters. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'arch/powerpc/platforms/iseries')
-rw-r--r--arch/powerpc/platforms/iseries/dt.c92
1 files changed, 17 insertions, 75 deletions
diff --git a/arch/powerpc/platforms/iseries/dt.c b/arch/powerpc/platforms/iseries/dt.c
index 39c676ab9d6d..c5f59a8b9ef3 100644
--- a/arch/powerpc/platforms/iseries/dt.c
+++ b/arch/powerpc/platforms/iseries/dt.c
@@ -80,87 +80,29 @@ static char __initdata device_type_vscsi[] = "vscsi";
80 80
81/* EBCDIC to ASCII conversion routines */ 81/* EBCDIC to ASCII conversion routines */
82 82
83unsigned char e2a(unsigned char x) 83static unsigned char __init e2a(unsigned char x)
84{ 84{
85 switch (x) { 85 switch (x) {
86 case 0xF0: 86 case 0x81 ... 0x89:
87 return '0'; 87 return x - 0x81 + 'a';
88 case 0xF1: 88 case 0x91 ... 0x99:
89 return '1'; 89 return x - 0x91 + 'j';
90 case 0xF2: 90 case 0xA2 ... 0xA9:
91 return '2'; 91 return x - 0xA2 + 's';
92 case 0xF3: 92 case 0xC1 ... 0xC9:
93 return '3'; 93 return x - 0xC1 + 'A';
94 case 0xF4: 94 case 0xD1 ... 0xD9:
95 return '4'; 95 return x - 0xD1 + 'J';
96 case 0xF5: 96 case 0xE2 ... 0xE9:
97 return '5'; 97 return x - 0xE2 + 'S';
98 case 0xF6: 98 case 0xF0 ... 0xF9:
99 return '6'; 99 return x - 0xF0 + '0';
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 } 100 }
159 return ' '; 101 return ' ';
160} 102}
161EXPORT_SYMBOL(e2a);
162 103
163unsigned char* strne2a(unsigned char *dest, const unsigned char *src, size_t n) 104static unsigned char * __init strne2a(unsigned char *dest,
105 const unsigned char *src, size_t n)
164{ 106{
165 int i; 107 int i;
166 108