aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-06-25 20:35:24 -0400
committerMike Frysinger <vapier@gentoo.org>2009-09-16 21:28:48 -0400
commitdc6b1ac98434d2c39d86de19aec9cf701b588c81 (patch)
tree20faf80389aa5f577f03c72f607e45fee6ed826d
parent22532578ee0f8725e0155e528c29ff992c1950c7 (diff)
Blackfin: cleanup printk() usage in module code
Convert all printk() statements to use the common pr_xxx() funcs and use the new pr_fmt() function to standardize all of the output. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--arch/blackfin/kernel/module.c59
1 files changed, 25 insertions, 34 deletions
diff --git a/arch/blackfin/kernel/module.c b/arch/blackfin/kernel/module.c
index bb940784cf2e..b8f4c67eb2ec 100644
--- a/arch/blackfin/kernel/module.c
+++ b/arch/blackfin/kernel/module.c
@@ -27,6 +27,7 @@
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */ 28 */
29 29
30#define pr_fmt(fmt) "module %s: " fmt
30 31
31#include <linux/moduleloader.h> 32#include <linux/moduleloader.h>
32#include <linux/elf.h> 33#include <linux/elf.h>
@@ -72,9 +73,8 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs,
72 dest = l1_inst_sram_alloc(s->sh_size); 73 dest = l1_inst_sram_alloc(s->sh_size);
73 mod->arch.text_l1 = dest; 74 mod->arch.text_l1 = dest;
74 if (dest == NULL) { 75 if (dest == NULL) {
75 printk(KERN_ERR 76 pr_err("L1 inst memory allocation failed\n",
76 "module %s: L1 instruction memory allocation failed\n", 77 mod->name);
77 mod->name);
78 return -1; 78 return -1;
79 } 79 }
80 dma_memcpy(dest, (void *)s->sh_addr, s->sh_size); 80 dma_memcpy(dest, (void *)s->sh_addr, s->sh_size);
@@ -87,8 +87,7 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs,
87 dest = l1_data_sram_alloc(s->sh_size); 87 dest = l1_data_sram_alloc(s->sh_size);
88 mod->arch.data_a_l1 = dest; 88 mod->arch.data_a_l1 = dest;
89 if (dest == NULL) { 89 if (dest == NULL) {
90 printk(KERN_ERR 90 pr_err("L1 data memory allocation failed\n",
91 "module %s: L1 data memory allocation failed\n",
92 mod->name); 91 mod->name);
93 return -1; 92 return -1;
94 } 93 }
@@ -102,8 +101,7 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs,
102 dest = l1_data_sram_alloc(s->sh_size); 101 dest = l1_data_sram_alloc(s->sh_size);
103 mod->arch.bss_a_l1 = dest; 102 mod->arch.bss_a_l1 = dest;
104 if (dest == NULL) { 103 if (dest == NULL) {
105 printk(KERN_ERR 104 pr_err("L1 data memory allocation failed\n",
106 "module %s: L1 data memory allocation failed\n",
107 mod->name); 105 mod->name);
108 return -1; 106 return -1;
109 } 107 }
@@ -115,8 +113,7 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs,
115 dest = l1_data_B_sram_alloc(s->sh_size); 113 dest = l1_data_B_sram_alloc(s->sh_size);
116 mod->arch.data_b_l1 = dest; 114 mod->arch.data_b_l1 = dest;
117 if (dest == NULL) { 115 if (dest == NULL) {
118 printk(KERN_ERR 116 pr_err("L1 data memory allocation failed\n",
119 "module %s: L1 data memory allocation failed\n",
120 mod->name); 117 mod->name);
121 return -1; 118 return -1;
122 } 119 }
@@ -128,8 +125,7 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs,
128 dest = l1_data_B_sram_alloc(s->sh_size); 125 dest = l1_data_B_sram_alloc(s->sh_size);
129 mod->arch.bss_b_l1 = dest; 126 mod->arch.bss_b_l1 = dest;
130 if (dest == NULL) { 127 if (dest == NULL) {
131 printk(KERN_ERR 128 pr_err("L1 data memory allocation failed\n",
132 "module %s: L1 data memory allocation failed\n",
133 mod->name); 129 mod->name);
134 return -1; 130 return -1;
135 } 131 }
@@ -143,9 +139,8 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs,
143 dest = l2_sram_alloc(s->sh_size); 139 dest = l2_sram_alloc(s->sh_size);
144 mod->arch.text_l2 = dest; 140 mod->arch.text_l2 = dest;
145 if (dest == NULL) { 141 if (dest == NULL) {
146 printk(KERN_ERR 142 pr_err("L2 SRAM allocation failed\n",
147 "module %s: L2 SRAM allocation failed\n", 143 mod->name);
148 mod->name);
149 return -1; 144 return -1;
150 } 145 }
151 memcpy(dest, (void *)s->sh_addr, s->sh_size); 146 memcpy(dest, (void *)s->sh_addr, s->sh_size);
@@ -158,8 +153,7 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs,
158 dest = l2_sram_alloc(s->sh_size); 153 dest = l2_sram_alloc(s->sh_size);
159 mod->arch.data_l2 = dest; 154 mod->arch.data_l2 = dest;
160 if (dest == NULL) { 155 if (dest == NULL) {
161 printk(KERN_ERR 156 pr_err("L2 SRAM allocation failed\n",
162 "module %s: L2 SRAM allocation failed\n",
163 mod->name); 157 mod->name);
164 return -1; 158 return -1;
165 } 159 }
@@ -173,8 +167,7 @@ module_frob_arch_sections(Elf_Ehdr * hdr, Elf_Shdr * sechdrs,
173 dest = l2_sram_alloc(s->sh_size); 167 dest = l2_sram_alloc(s->sh_size);
174 mod->arch.bss_l2 = dest; 168 mod->arch.bss_l2 = dest;
175 if (dest == NULL) { 169 if (dest == NULL) {
176 printk(KERN_ERR 170 pr_err("L2 SRAM allocation failed\n",
177 "module %s: L2 SRAM allocation failed\n",
178 mod->name); 171 mod->name);
179 return -1; 172 return -1;
180 } 173 }
@@ -190,7 +183,7 @@ int
190apply_relocate(Elf_Shdr * sechdrs, const char *strtab, 183apply_relocate(Elf_Shdr * sechdrs, const char *strtab,
191 unsigned int symindex, unsigned int relsec, struct module *me) 184 unsigned int symindex, unsigned int relsec, struct module *me)
192{ 185{
193 printk(KERN_ERR "module %s: .rel unsupported\n", me->name); 186 pr_err(".rel unsupported\n", me->name);
194 return -ENOEXEC; 187 return -ENOEXEC;
195} 188}
196 189
@@ -217,8 +210,8 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab,
217 uint16_t *location16; 210 uint16_t *location16;
218 uint32_t value; 211 uint32_t value;
219 212
220 pr_debug("Applying relocate section %u to %u\n", relsec, 213 pr_debug("applying relocate section %u to %u\n", mod->name,
221 sechdrs[relsec].sh_info); 214 relsec, sechdrs[relsec].sh_info);
222 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { 215 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
223 /* This is where to make the change */ 216 /* This is where to make the change */
224 location16 = 217 location16 =
@@ -231,21 +224,22 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab,
231 + ELF32_R_SYM(rel[i].r_info); 224 + ELF32_R_SYM(rel[i].r_info);
232 value = sym->st_value; 225 value = sym->st_value;
233 value += rel[i].r_addend; 226 value += rel[i].r_addend;
234 pr_debug("location is %x, value is %x type is %d \n", 227
235 (unsigned int) location32, value,
236 ELF32_R_TYPE(rel[i].r_info));
237#ifdef CONFIG_SMP 228#ifdef CONFIG_SMP
238 if ((unsigned long)location16 >= COREB_L1_DATA_A_START) { 229 if ((unsigned long)location16 >= COREB_L1_DATA_A_START) {
239 printk(KERN_ERR "module %s: cannot relocate in L1: %u (SMP kernel)", 230 pr_err("cannot relocate in L1: %u (SMP kernel)",
240 mod->name, ELF32_R_TYPE(rel[i].r_info)); 231 mod->name, ELF32_R_TYPE(rel[i].r_info));
241 return -ENOEXEC; 232 return -ENOEXEC;
242 } 233 }
243#endif 234#endif
235
236 pr_debug("location is %lx, value is %x type is %d\n",
237 mod->name, (unsigned long)location32, value,
238 ELF32_R_TYPE(rel[i].r_info));
239
244 switch (ELF32_R_TYPE(rel[i].r_info)) { 240 switch (ELF32_R_TYPE(rel[i].r_info)) {
245 241
246 case R_BFIN_LUIMM16: 242 case R_BFIN_LUIMM16:
247 pr_debug("before %x after %x\n", *location16,
248 (value & 0xffff));
249 tmp = (value & 0xffff); 243 tmp = (value & 0xffff);
250 if ((unsigned long)location16 >= L1_CODE_START) { 244 if ((unsigned long)location16 >= L1_CODE_START) {
251 dma_memcpy(location16, &tmp, 2); 245 dma_memcpy(location16, &tmp, 2);
@@ -253,8 +247,6 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab,
253 *location16 = tmp; 247 *location16 = tmp;
254 break; 248 break;
255 case R_BFIN_HUIMM16: 249 case R_BFIN_HUIMM16:
256 pr_debug("before %x after %x\n", *location16,
257 ((value >> 16) & 0xffff));
258 tmp = ((value >> 16) & 0xffff); 250 tmp = ((value >> 16) & 0xffff);
259 if ((unsigned long)location16 >= L1_CODE_START) { 251 if ((unsigned long)location16 >= L1_CODE_START) {
260 dma_memcpy(location16, &tmp, 2); 252 dma_memcpy(location16, &tmp, 2);
@@ -265,7 +257,6 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab,
265 *location16 = (value & 0xffff); 257 *location16 = (value & 0xffff);
266 break; 258 break;
267 case R_BFIN_BYTE4_DATA: 259 case R_BFIN_BYTE4_DATA:
268 pr_debug("before %x after %x\n", *location32, value);
269 *location32 = value; 260 *location32 = value;
270 break; 261 break;
271 case R_BFIN_PCREL24: 262 case R_BFIN_PCREL24:
@@ -273,12 +264,12 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab,
273 case R_BFIN_PCREL12_JUMP: 264 case R_BFIN_PCREL12_JUMP:
274 case R_BFIN_PCREL12_JUMP_S: 265 case R_BFIN_PCREL12_JUMP_S:
275 case R_BFIN_PCREL10: 266 case R_BFIN_PCREL10:
276 printk(KERN_ERR "module %s: Unsupported relocation: %u (no -mlong-calls?)\n" 267 pr_err("unsupported relocation: %u (no -mlong-calls?)\n",
277 mod->name, ELF32_R_TYPE(rel[i].r_info)); 268 mod->name, ELF32_R_TYPE(rel[i].r_info));
278 return -ENOEXEC; 269 return -ENOEXEC;
279 default: 270 default:
280 printk(KERN_ERR "module %s: Unknown relocation: %u\n", 271 pr_err("unknown relocation: %u\n", mod->name,
281 mod->name, ELF32_R_TYPE(rel[i].r_info)); 272 ELF32_R_TYPE(rel[i].r_info));
282 return -ENOEXEC; 273 return -ENOEXEC;
283 } 274 }
284 } 275 }