Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: APRP: Code formatting clean-ups.

Clean-up code according to the 'checkpatch.pl' script.

Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
Reviewed-by: Qais Yousef <Qais.Yousef@imgtec.com>
Patchwork: http://patchwork.linux-mips.org/patch/6097/
Reviewed-by: John Crispin <blogic@openwrt.org>

authored by

Steven J. Hill and committed by
Ralf Baechle
5792bf64 1336113a

+247 -319
-1
arch/mips/Kconfig
··· 1950 1950 you to ensure the amount you put in the option and the space your 1951 1951 program requires is less or equal to the amount physically present. 1952 1952 1953 - # this should possibly be in drivers/char, but it is rather cpu related. Hmmm 1954 1953 config MIPS_VPE_APSP_API 1955 1954 bool "Enable support for AP/SP API (RTLX)" 1956 1955 depends on MIPS_VPE_LOADER
+10 -5
arch/mips/include/asm/amon.h
··· 1 1 /* 2 - * Amon support 2 + * This file is subject to the terms and conditions of the GNU General Public 3 + * License. See the file "COPYING" in the main directory of this archive 4 + * for more details. 5 + * 6 + * Copyright (C) 2013 Imagination Technologies Ltd. 7 + * 8 + * Arbitrary Monitor Support (AMON) 3 9 */ 4 - 5 - int amon_cpu_avail(int); 6 - int amon_cpu_start(int, unsigned long, unsigned long, 7 - unsigned long, unsigned long); 10 + int amon_cpu_avail(int cpu); 11 + int amon_cpu_start(int cpu, unsigned long pc, unsigned long sp, 12 + unsigned long gp, unsigned long a0);
+4 -1
arch/mips/include/asm/rtlx.h
··· 1 1 /* 2 + * This file is subject to the terms and conditions of the GNU General Public 3 + * License. See the file "COPYING" in the main directory of this archive 4 + * for more details. 5 + * 2 6 * Copyright (C) 2004, 2005 MIPS Technologies, Inc. All rights reserved. 3 7 * Copyright (C) 2013 Imagination Technologies Ltd. 4 8 */ 5 - 6 9 #ifndef __ASM_RTLX_H_ 7 10 #define __ASM_RTLX_H_ 8 11
+4 -15
arch/mips/include/asm/vpe.h
··· 1 1 /* 2 + * This file is subject to the terms and conditions of the GNU General Public 3 + * License. See the file "COPYING" in the main directory of this archive 4 + * for more details. 5 + * 2 6 * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved. 3 7 * Copyright (C) 2013 Imagination Technologies Ltd. 4 - * 5 - * This program is free software; you can distribute it and/or modify it 6 - * under the terms of the GNU General Public License (Version 2) as 7 - * published by the Free Software Foundation. 8 - * 9 - * This program is distributed in the hope it will be useful, but WITHOUT 10 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 - * for more details. 13 - * 14 - * You should have received a copy of the GNU General Public License along 15 - * with this program; if not, write to the Free Software Foundation, Inc., 16 - * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. 17 - * 18 8 */ 19 - 20 9 #ifndef _ASM_VPE_H 21 10 #define _ASM_VPE_H 22 11
+52 -79
arch/mips/kernel/rtlx.c
··· 1 1 /* 2 + * This file is subject to the terms and conditions of the GNU General Public 3 + * License. See the file "COPYING" in the main directory of this archive 4 + * for more details. 5 + * 2 6 * Copyright (C) 2005 MIPS Technologies, Inc. All rights reserved. 3 7 * Copyright (C) 2005, 06 Ralf Baechle (ralf@linux-mips.org) 4 - * 5 - * This program is free software; you can distribute it and/or modify it 6 - * under the terms of the GNU General Public License (Version 2) as 7 - * published by the Free Software Foundation. 8 - * 9 - * This program is distributed in the hope it will be useful, but WITHOUT 10 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 - * for more details. 13 - * 14 - * You should have received a copy of the GNU General Public License along 15 - * with this program; if not, write to the Free Software Foundation, Inc., 16 - * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. 17 - * 8 + * Copyright (C) 2013 Imagination Technologies Ltd. 18 9 */ 19 - 20 - #include <linux/device.h> 21 10 #include <linux/kernel.h> 22 11 #include <linux/fs.h> 23 - #include <linux/init.h> 24 - #include <asm/uaccess.h> 25 - #include <linux/list.h> 26 - #include <linux/vmalloc.h> 27 - #include <linux/elf.h> 28 - #include <linux/seq_file.h> 29 12 #include <linux/syscalls.h> 30 13 #include <linux/moduleloader.h> 31 - #include <linux/interrupt.h> 32 - #include <linux/poll.h> 33 - #include <linux/sched.h> 34 - #include <linux/wait.h> 14 + #include <linux/atomic.h> 35 15 #include <asm/mipsmtregs.h> 36 16 #include <asm/mips_mt.h> 37 - #include <asm/cacheflush.h> 38 - #include <linux/atomic.h> 39 - #include <asm/cpu.h> 40 17 #include <asm/processor.h> 41 - #include <asm/vpe.h> 42 18 #include <asm/rtlx.h> 43 19 #include <asm/setup.h> 20 + #include <asm/vpe.h> 44 21 45 22 static int sp_stopping; 46 23 struct rtlx_info *rtlx; ··· 30 53 { 31 54 int i; 32 55 33 - printk("id 0x%lx state %d\n", rtlx->id, rtlx->state); 56 + pr_info("id 0x%lx state %d\n", rtlx->id, rtlx->state); 34 57 35 58 for (i = 0; i < RTLX_CHANNELS; i++) { 36 59 struct rtlx_channel *chan = &rtlx->channel[i]; 37 60 38 - printk(" rt_state %d lx_state %d buffer_size %d\n", 39 - chan->rt_state, chan->lx_state, chan->buffer_size); 61 + pr_info(" rt_state %d lx_state %d buffer_size %d\n", 62 + chan->rt_state, chan->lx_state, chan->buffer_size); 40 63 41 - printk(" rt_read %d rt_write %d\n", 42 - chan->rt_read, chan->rt_write); 64 + pr_info(" rt_read %d rt_write %d\n", 65 + chan->rt_read, chan->rt_write); 43 66 44 - printk(" lx_read %d lx_write %d\n", 45 - chan->lx_read, chan->lx_write); 67 + pr_info(" lx_read %d lx_write %d\n", 68 + chan->lx_read, chan->lx_write); 46 69 47 - printk(" rt_buffer <%s>\n", chan->rt_buffer); 48 - printk(" lx_buffer <%s>\n", chan->lx_buffer); 70 + pr_info(" rt_buffer <%s>\n", chan->rt_buffer); 71 + pr_info(" lx_buffer <%s>\n", chan->lx_buffer); 49 72 } 50 73 } 51 74 ··· 53 76 static int rtlx_init(struct rtlx_info *rtlxi) 54 77 { 55 78 if (rtlxi->id != RTLX_ID) { 56 - printk(KERN_ERR "no valid RTLX id at 0x%p 0x%lx\n", 57 - rtlxi, rtlxi->id); 79 + pr_err("no valid RTLX id at 0x%p 0x%lx\n", rtlxi, rtlxi->id); 58 80 return -ENOEXEC; 59 81 } 60 82 ··· 69 93 sp_stopping = 0; 70 94 71 95 /* force a reload of rtlx */ 72 - rtlx=NULL; 96 + rtlx = NULL; 73 97 74 98 /* wake up any sleeping rtlx_open's */ 75 99 for (i = 0; i < RTLX_CHANNELS; i++) ··· 94 118 int ret = 0; 95 119 96 120 if (index >= RTLX_CHANNELS) { 97 - printk(KERN_DEBUG "rtlx_open index out of range\n"); 121 + pr_debug(KERN_DEBUG "rtlx_open index out of range\n"); 98 122 return -ENOSYS; 99 123 } 100 124 101 125 if (atomic_inc_return(&channel_wqs[index].in_open) > 1) { 102 - printk(KERN_DEBUG "rtlx_open channel %d already opened\n", 103 - index); 126 + pr_debug(KERN_DEBUG "rtlx_open channel %d already opened\n", index); 104 127 ret = -EBUSY; 105 128 goto out_fail; 106 129 } 107 130 108 131 if (rtlx == NULL) { 109 - if( (p = vpe_get_shared(tclimit)) == NULL) { 110 - if (can_sleep) { 111 - ret = __wait_event_interruptible( 132 + p = vpe_get_shared(aprp_cpu_index()); 133 + if (p == NULL) { 134 + if (can_sleep) { 135 + ret = __wait_event_interruptible( 112 136 channel_wqs[index].lx_queue, 113 - (p = vpe_get_shared(tclimit))); 114 - if (ret) 137 + (p = vpe_get_shared(aprp_cpu_index()))); 138 + if (ret) 139 + goto out_fail; 140 + } else { 141 + pr_debug("No SP program loaded, and device opened with O_NONBLOCK\n"); 142 + ret = -ENOSYS; 115 143 goto out_fail; 116 - } else { 117 - printk(KERN_DEBUG "No SP program loaded, and device " 118 - "opened with O_NONBLOCK\n"); 119 - ret = -ENOSYS; 120 - goto out_fail; 121 - } 144 + } 122 145 } 123 146 124 147 smp_rmb(); ··· 139 164 ret = -ERESTARTSYS; 140 165 goto out_fail; 141 166 } 142 - finish_wait(&channel_wqs[index].lx_queue, &wait); 167 + finish_wait(&channel_wqs[index].lx_queue, 168 + &wait); 143 169 } else { 144 - pr_err(" *vpe_get_shared is NULL. " 145 - "Has an SP program been loaded?\n"); 170 + pr_err(" *vpe_get_shared is NULL. Has an SP program been loaded?\n"); 146 171 ret = -ENOSYS; 147 172 goto out_fail; 148 173 } 149 174 } 150 175 151 176 if ((unsigned int)*p < KSEG0) { 152 - printk(KERN_WARNING "vpe_get_shared returned an " 153 - "invalid pointer maybe an error code %d\n", 154 - (int)*p); 177 + pr_warn("vpe_get_shared returned an invalid pointer maybe an error code %d\n", 178 + (int)*p); 155 179 ret = -ENOSYS; 156 180 goto out_fail; 157 181 } 158 182 159 - if ((ret = rtlx_init(*p)) < 0) 183 + ret = rtlx_init(*p); 184 + if (ret < 0) 160 185 goto out_ret; 161 186 } 162 187 ··· 287 312 size_t fl; 288 313 289 314 if (rtlx == NULL) 290 - return(-ENOSYS); 315 + return -ENOSYS; 291 316 292 317 rt = &rtlx->channel[index]; 293 318 ··· 296 321 rt_read = rt->rt_read; 297 322 298 323 /* total number of bytes to copy */ 299 - count = min(count, (size_t)write_spacefree(rt_read, rt->rt_write, 300 - rt->buffer_size)); 324 + count = min_t(size_t, count, write_spacefree(rt_read, rt->rt_write, 325 + rt->buffer_size)); 301 326 302 327 /* first bit from write pointer to the end of the buffer, or count */ 303 328 fl = min(count, (size_t) rt->buffer_size - rt->rt_write); ··· 307 332 goto out; 308 333 309 334 /* if there's any left copy to the beginning of the buffer */ 310 - if (count - fl) { 335 + if (count - fl) 311 336 failed = copy_from_user(rt->rt_buffer, buffer + fl, count - fl); 312 - } 313 337 314 338 out: 315 339 count -= failed; ··· 334 360 return rtlx_release(iminor(inode)); 335 361 } 336 362 337 - static unsigned int file_poll(struct file *file, poll_table * wait) 363 + static unsigned int file_poll(struct file *file, poll_table *wait) 338 364 { 339 365 int minor = iminor(file_inode(file)); 340 366 unsigned int mask = 0; ··· 356 382 return mask; 357 383 } 358 384 359 - static ssize_t file_read(struct file *file, char __user * buffer, size_t count, 360 - loff_t * ppos) 385 + static ssize_t file_read(struct file *file, char __user *buffer, size_t count, 386 + loff_t *ppos) 361 387 { 362 388 int minor = iminor(file_inode(file)); 363 389 364 390 /* data available? */ 365 - if (!rtlx_read_poll(minor, (file->f_flags & O_NONBLOCK) ? 0 : 1)) { 366 - return 0; // -EAGAIN makes cat whinge 367 - } 391 + if (!rtlx_read_poll(minor, (file->f_flags & O_NONBLOCK) ? 0 : 1)) 392 + return 0; /* -EAGAIN makes 'cat' whine */ 368 393 369 394 return rtlx_read(minor, buffer, count); 370 395 } 371 396 372 - static ssize_t file_write(struct file *file, const char __user * buffer, 373 - size_t count, loff_t * ppos) 397 + static ssize_t file_write(struct file *file, const char __user *buffer, 398 + size_t count, loff_t *ppos) 374 399 { 375 400 int minor = iminor(file_inode(file)); 376 401 ··· 391 418 392 419 const struct file_operations rtlx_fops = { 393 420 .owner = THIS_MODULE, 394 - .open = file_open, 421 + .open = file_open, 395 422 .release = file_release, 396 423 .write = file_write, 397 - .read = file_read, 398 - .poll = file_poll, 424 + .read = file_read, 425 + .poll = file_poll, 399 426 .llseek = noop_llseek, 400 427 }; 401 428
+3 -3
arch/mips/kernel/vpe-mt.c
··· 26 26 int vpe_run(struct vpe *v) 27 27 { 28 28 unsigned long flags, val, dmt_flag; 29 - struct vpe_notifications *n; 29 + struct vpe_notifications *notifier; 30 30 unsigned int vpeflags; 31 31 struct tc *t; 32 32 ··· 139 139 emt(dmt_flag); 140 140 local_irq_restore(flags); 141 141 142 - list_for_each_entry(n, &v->notify, list) 143 - n->start(VPE_MODULE_MINOR); 142 + list_for_each_entry(notifier, &v->notify, list) 143 + notifier->start(VPE_MODULE_MINOR); 144 144 145 145 return 0; 146 146 }
+111 -139
arch/mips/kernel/vpe.c
··· 1 1 /* 2 + * This file is subject to the terms and conditions of the GNU General Public 3 + * License. See the file "COPYING" in the main directory of this archive 4 + * for more details. 5 + * 2 6 * Copyright (C) 2004, 2005 MIPS Technologies, Inc. All rights reserved. 7 + * Copyright (C) 2013 Imagination Technologies Ltd. 3 8 * 4 - * This program is free software; you can distribute it and/or modify it 5 - * under the terms of the GNU General Public License (Version 2) as 6 - * published by the Free Software Foundation. 7 - * 8 - * This program is distributed in the hope it will be useful, but WITHOUT 9 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 11 - * for more details. 12 - * 13 - * You should have received a copy of the GNU General Public License along 14 - * with this program; if not, write to the Free Software Foundation, Inc., 15 - * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. 16 - */ 17 - 18 - /* 19 - * VPE support module 20 - * 21 - * Provides support for loading a MIPS SP program on VPE1. 22 - * The SP environment is rather simple, no tlb's. It needs to be relocatable 23 - * (or partially linked). You should initialise your stack in the startup 24 - * code. This loader looks for the symbol __start and sets up 25 - * execution to resume from there. The MIPS SDE kit contains suitable examples. 26 - * 27 - * To load and run, simply cat a SP 'program file' to /dev/vpe1. 28 - * i.e cat spapp >/dev/vpe1. 9 + * VPE spport module for loading a MIPS SP program into VPE1. The SP 10 + * environment is rather simple since there are no TLBs. It needs 11 + * to be relocatable (or partiall linked). Initialize your stack in 12 + * the startup-code. The loader looks for the symbol __start and sets 13 + * up the execution to resume from there. To load and run, simply do 14 + * a cat SP 'binary' to the /dev/vpe1 device. 29 15 */ 30 16 #include <linux/kernel.h> 31 17 #include <linux/device.h> 32 18 #include <linux/fs.h> 33 19 #include <linux/init.h> 34 - #include <asm/uaccess.h> 35 20 #include <linux/slab.h> 36 21 #include <linux/list.h> 37 22 #include <linux/vmalloc.h> ··· 31 46 #include <asm/mipsmtregs.h> 32 47 #include <asm/cacheflush.h> 33 48 #include <linux/atomic.h> 34 - #include <asm/cpu.h> 35 49 #include <asm/mips_mt.h> 36 50 #include <asm/processor.h> 37 51 #include <asm/vpe.h> ··· 93 109 { 94 110 struct vpe *v; 95 111 96 - if ((v = kzalloc(sizeof(struct vpe), GFP_KERNEL)) == NULL) 97 - return NULL; 112 + v = kzalloc(sizeof(struct vpe), GFP_KERNEL); 113 + if (v == NULL) 114 + goto out; 98 115 99 116 INIT_LIST_HEAD(&v->tc); 100 117 spin_lock(&vpecontrol.vpe_list_lock); ··· 105 120 INIT_LIST_HEAD(&v->notify); 106 121 v->minor = VPE_MODULE_MINOR; 107 122 123 + out: 108 124 return v; 109 125 } 110 126 ··· 114 128 { 115 129 struct tc *tc; 116 130 117 - if ((tc = kzalloc(sizeof(struct tc), GFP_KERNEL)) == NULL) 131 + tc = kzalloc(sizeof(struct tc), GFP_KERNEL); 132 + if (tc == NULL) 118 133 goto out; 119 134 120 135 INIT_LIST_HEAD(&tc->tc); ··· 138 151 kfree(v); 139 152 } 140 153 141 - /* Find some VPE program space */ 154 + /* Find some VPE program space */ 142 155 void *alloc_progmem(unsigned long len) 143 156 { 144 157 void *addr; ··· 166 179 } 167 180 168 181 /* Update size with this section: return offset. */ 169 - static long get_offset(unsigned long *size, Elf_Shdr * sechdr) 182 + static long get_offset(unsigned long *size, Elf_Shdr *sechdr) 170 183 { 171 184 long ret; 172 185 ··· 179 192 might -- code, read-only data, read-write data, small data. Tally 180 193 sizes, and place the offsets into sh_entsize fields: high bit means it 181 194 belongs in init. */ 182 - static void layout_sections(struct module *mod, const Elf_Ehdr * hdr, 183 - Elf_Shdr * sechdrs, const char *secstrings) 195 + static void layout_sections(struct module *mod, const Elf_Ehdr *hdr, 196 + Elf_Shdr *sechdrs, const char *secstrings) 184 197 { 185 198 static unsigned long const masks[][2] = { 186 199 /* NOTE: all executable code must be the first section ··· 200 213 for (i = 0; i < hdr->e_shnum; ++i) { 201 214 Elf_Shdr *s = &sechdrs[i]; 202 215 203 - // || strncmp(secstrings + s->sh_name, ".init", 5) == 0) 204 216 if ((s->sh_flags & masks[m][0]) != masks[m][0] 205 217 || (s->sh_flags & masks[m][1]) 206 218 || s->sh_entsize != ~0UL) ··· 213 227 214 228 } 215 229 } 216 - 217 230 218 231 /* from module-elf32.c, but subverted a little */ 219 232 ··· 236 251 { 237 252 int rel; 238 253 239 - if( !(*location & 0xffff) ) { 254 + if (!(*location & 0xffff)) { 240 255 rel = (int)v - gp_addr; 241 - } 242 - else { 256 + } else { 243 257 /* .sbss + gp(relative) + offset */ 244 258 /* kludge! */ 245 259 rel = (int)(short)((int)v + gp_offs + 246 260 (int)(short)(*location & 0xffff) - gp_addr); 247 261 } 248 262 249 - if( (rel > 32768) || (rel < -32768) ) { 250 - printk(KERN_DEBUG "VPE loader: apply_r_mips_gprel16: " 251 - "relative address 0x%x out of range of gp register\n", 252 - rel); 263 + if ((rel > 32768) || (rel < -32768)) { 264 + pr_debug("VPE loader: apply_r_mips_gprel16: relative address 0x%x out of range of gp register\n", 265 + rel); 253 266 return -ENOEXEC; 254 267 } 255 268 ··· 261 278 { 262 279 int rel; 263 280 rel = (((unsigned int)v - (unsigned int)location)); 264 - rel >>= 2; // because the offset is in _instructions_ not bytes. 265 - rel -= 1; // and one instruction less due to the branch delay slot. 281 + rel >>= 2; /* because the offset is in _instructions_ not bytes. */ 282 + rel -= 1; /* and one instruction less due to the branch delay slot. */ 266 283 267 - if( (rel > 32768) || (rel < -32768) ) { 268 - printk(KERN_DEBUG "VPE loader: " 269 - "apply_r_mips_pc16: relative address out of range 0x%x\n", rel); 284 + if ((rel > 32768) || (rel < -32768)) { 285 + pr_debug("VPE loader: apply_r_mips_pc16: relative address out of range 0x%x\n", 286 + rel); 270 287 return -ENOEXEC; 271 288 } 272 289 ··· 287 304 Elf32_Addr v) 288 305 { 289 306 if (v % 4) { 290 - printk(KERN_DEBUG "VPE loader: apply_r_mips_26 " 291 - " unaligned relocation\n"); 307 + pr_debug("VPE loader: apply_r_mips_26: unaligned relocation\n"); 292 308 return -ENOEXEC; 293 309 } 294 310 ··· 318 336 * the carry we need to add. Save the information, and let LO16 do the 319 337 * actual relocation. 320 338 */ 321 - n = kmalloc(sizeof *n, GFP_KERNEL); 339 + n = kmalloc(sizeof(*n), GFP_KERNEL); 322 340 if (!n) 323 341 return -ENOMEM; 324 342 ··· 350 368 * The value for the HI16 had best be the same. 351 369 */ 352 370 if (v != l->value) { 353 - printk(KERN_DEBUG "VPE loader: " 354 - "apply_r_mips_lo16/hi16: \t" 355 - "inconsistent value information\n"); 371 + pr_debug("VPE loader: apply_r_mips_lo16/hi16: inconsistent value information\n"); 356 372 goto out_free; 357 373 } 358 374 ··· 446 466 + ELF32_R_SYM(r_info); 447 467 448 468 if (!sym->st_value) { 449 - printk(KERN_DEBUG "%s: undefined weak symbol %s\n", 450 - me->name, strtab + sym->st_name); 469 + pr_debug("%s: undefined weak symbol %s\n", 470 + me->name, strtab + sym->st_name); 451 471 /* just print the warning, dont barf */ 452 472 } 453 473 454 474 v = sym->st_value; 455 475 456 476 res = reloc_handlers[ELF32_R_TYPE(r_info)](me, location, v); 457 - if( res ) { 477 + if (res) { 458 478 char *r = rstrs[ELF32_R_TYPE(r_info)]; 459 - printk(KERN_WARNING "VPE loader: .text+0x%x " 460 - "relocation type %s for symbol \"%s\" failed\n", 461 - rel[i].r_offset, r ? r : "UNKNOWN", 462 - strtab + sym->st_name); 479 + pr_warn("VPE loader: .text+0x%x relocation type %s for symbol \"%s\" failed\n", 480 + rel[i].r_offset, r ? r : "UNKNOWN", 481 + strtab + sym->st_name); 463 482 return res; 464 483 } 465 484 } ··· 473 494 } 474 495 /* end module-elf32.c */ 475 496 476 - 477 - 478 497 /* Change all symbols so that sh_value encodes the pointer directly. */ 479 - static void simplify_symbols(Elf_Shdr * sechdrs, 498 + static void simplify_symbols(Elf_Shdr *sechdrs, 480 499 unsigned int symindex, 481 500 const char *strtab, 482 501 const char *secstrings, ··· 515 538 break; 516 539 517 540 case SHN_MIPS_SCOMMON: 518 - printk(KERN_DEBUG "simplify_symbols: ignoring SHN_MIPS_SCOMMON " 519 - "symbol <%s> st_shndx %d\n", strtab + sym[i].st_name, 520 - sym[i].st_shndx); 521 - // .sbss section 541 + pr_debug("simplify_symbols: ignoring SHN_MIPS_SCOMMON symbol <%s> st_shndx %d\n", 542 + strtab + sym[i].st_name, sym[i].st_shndx); 543 + /* .sbss section */ 522 544 break; 523 545 524 546 default: 525 547 secbase = sechdrs[sym[i].st_shndx].sh_addr; 526 548 527 - if (strncmp(strtab + sym[i].st_name, "_gp", 3) == 0) { 549 + if (strncmp(strtab + sym[i].st_name, "_gp", 3) == 0) 528 550 save_gp_address(secbase, sym[i].st_value); 529 - } 530 551 531 552 sym[i].st_value += secbase; 532 553 break; ··· 533 558 } 534 559 535 560 #ifdef DEBUG_ELFLOADER 536 - static void dump_elfsymbols(Elf_Shdr * sechdrs, unsigned int symindex, 561 + static void dump_elfsymbols(Elf_Shdr *sechdrs, unsigned int symindex, 537 562 const char *strtab, struct module *mod) 538 563 { 539 564 Elf_Sym *sym = (void *)sechdrs[symindex].sh_addr; 540 565 unsigned int i, n = sechdrs[symindex].sh_size / sizeof(Elf_Sym); 541 566 542 - printk(KERN_DEBUG "dump_elfsymbols: n %d\n", n); 567 + pr_debug("dump_elfsymbols: n %d\n", n); 543 568 for (i = 1; i < n; i++) { 544 - printk(KERN_DEBUG " i %d name <%s> 0x%x\n", i, 545 - strtab + sym[i].st_name, sym[i].st_value); 569 + pr_debug(" i %d name <%s> 0x%x\n", i, strtab + sym[i].st_name, 570 + sym[i].st_value); 546 571 } 547 572 } 548 573 #endif 549 574 550 - static int find_vpe_symbols(struct vpe * v, Elf_Shdr * sechdrs, 575 + static int find_vpe_symbols(struct vpe *v, Elf_Shdr *sechdrs, 551 576 unsigned int symindex, const char *strtab, 552 577 struct module *mod) 553 578 { ··· 555 580 unsigned int i, n = sechdrs[symindex].sh_size / sizeof(Elf_Sym); 556 581 557 582 for (i = 1; i < n; i++) { 558 - if (strcmp(strtab + sym[i].st_name, "__start") == 0) { 583 + if (strcmp(strtab + sym[i].st_name, "__start") == 0) 559 584 v->__start = sym[i].st_value; 560 - } 561 585 562 - if (strcmp(strtab + sym[i].st_name, "vpe_shared") == 0) { 586 + if (strcmp(strtab + sym[i].st_name, "vpe_shared") == 0) 563 587 v->shared_ptr = (void *)sym[i].st_value; 564 - } 565 588 } 566 589 567 - if ( (v->__start == 0) || (v->shared_ptr == NULL)) 590 + if ((v->__start == 0) || (v->shared_ptr == NULL)) 568 591 return -1; 569 592 570 593 return 0; ··· 573 600 * contents of the program (p)buffer performing relocatations/etc, free's it 574 601 * when finished. 575 602 */ 576 - static int vpe_elfload(struct vpe * v) 603 + static int vpe_elfload(struct vpe *v) 577 604 { 578 605 Elf_Ehdr *hdr; 579 606 Elf_Shdr *sechdrs; 580 607 long err = 0; 581 608 char *secstrings, *strtab = NULL; 582 609 unsigned int len, i, symindex = 0, strindex = 0, relocate = 0; 583 - struct module mod; // so we can re-use the relocations code 610 + struct module mod; /* so we can re-use the relocations code */ 584 611 585 612 memset(&mod, 0, sizeof(struct module)); 586 613 strcpy(mod.name, "VPE loader"); ··· 594 621 || (hdr->e_type != ET_REL && hdr->e_type != ET_EXEC) 595 622 || !elf_check_arch(hdr) 596 623 || hdr->e_shentsize != sizeof(*sechdrs)) { 597 - printk(KERN_WARNING 598 - "VPE loader: program wrong arch or weird elf version\n"); 624 + pr_warn("VPE loader: program wrong arch or weird elf version\n"); 599 625 600 626 return -ENOEXEC; 601 627 } ··· 603 631 relocate = 1; 604 632 605 633 if (len < hdr->e_shoff + hdr->e_shnum * sizeof(Elf_Shdr)) { 606 - printk(KERN_ERR "VPE loader: program length %u truncated\n", 607 - len); 634 + pr_err("VPE loader: program length %u truncated\n", len); 608 635 609 636 return -ENOEXEC; 610 637 } ··· 618 647 619 648 if (relocate) { 620 649 for (i = 1; i < hdr->e_shnum; i++) { 621 - if (sechdrs[i].sh_type != SHT_NOBITS 622 - && len < sechdrs[i].sh_offset + sechdrs[i].sh_size) { 623 - printk(KERN_ERR "VPE program length %u truncated\n", 650 + if ((sechdrs[i].sh_type != SHT_NOBITS) && 651 + (len < sechdrs[i].sh_offset + sechdrs[i].sh_size)) { 652 + pr_err("VPE program length %u truncated\n", 624 653 len); 625 654 return -ENOEXEC; 626 655 } 627 656 628 657 /* Mark all sections sh_addr with their address in the 629 658 temporary image. */ 630 - sechdrs[i].sh_addr = (size_t) hdr + sechdrs[i].sh_offset; 659 + sechdrs[i].sh_addr = (size_t) hdr + 660 + sechdrs[i].sh_offset; 631 661 632 662 /* Internal symbols and strings. */ 633 663 if (sechdrs[i].sh_type == SHT_SYMTAB) { 634 664 symindex = i; 635 665 strindex = sechdrs[i].sh_link; 636 - strtab = (char *)hdr + sechdrs[strindex].sh_offset; 666 + strtab = (char *)hdr + 667 + sechdrs[strindex].sh_offset; 637 668 } 638 669 } 639 670 layout_sections(&mod, hdr, sechdrs, secstrings); ··· 662 689 /* Update sh_addr to point to copy in image. */ 663 690 sechdrs[i].sh_addr = (unsigned long)dest; 664 691 665 - printk(KERN_DEBUG " section sh_name %s sh_addr 0x%x\n", 666 - secstrings + sechdrs[i].sh_name, sechdrs[i].sh_addr); 692 + pr_debug(" section sh_name %s sh_addr 0x%x\n", 693 + secstrings + sechdrs[i].sh_name, 694 + sechdrs[i].sh_addr); 667 695 } 668 696 669 697 /* Fix up syms, so that st_value is a pointer to location. */ ··· 685 711 continue; 686 712 687 713 if (sechdrs[i].sh_type == SHT_REL) 688 - err = apply_relocations(sechdrs, strtab, symindex, i, 689 - &mod); 714 + err = apply_relocations(sechdrs, strtab, 715 + symindex, i, &mod); 690 716 else if (sechdrs[i].sh_type == SHT_RELA) 691 - err = apply_relocate_add(sechdrs, strtab, symindex, i, 692 - &mod); 717 + err = apply_relocate_add(sechdrs, strtab, 718 + symindex, i, &mod); 693 719 if (err < 0) 694 720 return err; 695 721 696 722 } 697 723 } else { 698 - struct elf_phdr *phdr = (struct elf_phdr *) ((char *)hdr + hdr->e_phoff); 724 + struct elf_phdr *phdr = (struct elf_phdr *) 725 + ((char *)hdr + hdr->e_phoff); 699 726 700 727 for (i = 0; i < hdr->e_phnum; i++) { 701 728 if (phdr->p_type == PT_LOAD) { ··· 714 739 if (sechdrs[i].sh_type == SHT_SYMTAB) { 715 740 symindex = i; 716 741 strindex = sechdrs[i].sh_link; 717 - strtab = (char *)hdr + sechdrs[strindex].sh_offset; 742 + strtab = (char *)hdr + 743 + sechdrs[strindex].sh_offset; 718 744 719 - /* mark the symtab's address for when we try to find the 720 - magic symbols */ 721 - sechdrs[i].sh_addr = (size_t) hdr + sechdrs[i].sh_offset; 745 + /* 746 + * mark symtab's address for when we try 747 + * to find the magic symbols 748 + */ 749 + sechdrs[i].sh_addr = (size_t) hdr + 750 + sechdrs[i].sh_offset; 722 751 } 723 752 } 724 753 } ··· 733 754 734 755 if ((find_vpe_symbols(v, sechdrs, symindex, strtab, &mod)) < 0) { 735 756 if (v->__start == 0) { 736 - printk(KERN_WARNING "VPE loader: program does not contain " 737 - "a __start symbol\n"); 757 + pr_warn("VPE loader: program does not contain a __start symbol\n"); 738 758 return -ENOEXEC; 739 759 } 740 760 741 761 if (v->shared_ptr == NULL) 742 - printk(KERN_WARNING "VPE loader: " 743 - "program does not contain vpe_shared symbol.\n" 744 - " Unable to use AMVP (AP/SP) facilities.\n"); 762 + pr_warn("VPE loader: program does not contain vpe_shared symbol.\n" 763 + " Unable to use AMVP (AP/SP) facilities.\n"); 745 764 } 746 765 747 - printk(" elf loaded\n"); 766 + pr_info(" elf loaded\n"); 748 767 return 0; 749 768 } 750 769 ··· 765 788 static int vpe_open(struct inode *inode, struct file *filp) 766 789 { 767 790 enum vpe_state state; 768 - struct vpe_notifications *not; 791 + struct vpe_notifications *notifier; 769 792 struct vpe *v; 770 793 int ret; 771 794 772 795 if (VPE_MODULE_MINOR != iminor(inode)) { 773 796 /* assume only 1 device at the moment. */ 774 - pr_warning("VPE loader: only vpe1 is supported\n"); 797 + pr_warn("VPE loader: only vpe1 is supported\n"); 775 798 776 799 return -ENODEV; 777 800 } 778 801 779 - if ((v = get_vpe(aprp_cpu_index())) == NULL) { 780 - pr_warning("VPE loader: unable to get vpe\n"); 802 + v = get_vpe(aprp_cpu_index()); 803 + if (v == NULL) { 804 + pr_warn("VPE loader: unable to get vpe\n"); 781 805 782 806 return -ENODEV; 783 807 } 784 808 785 809 state = xchg(&v->state, VPE_STATE_INUSE); 786 810 if (state != VPE_STATE_UNUSED) { 787 - printk(KERN_DEBUG "VPE loader: tc in use dumping regs\n"); 811 + pr_debug("VPE loader: tc in use dumping regs\n"); 788 812 789 - list_for_each_entry(not, &v->notify, list) { 790 - not->stop(aprp_cpu_index()); 791 - } 813 + list_for_each_entry(notifier, &v->notify, list) 814 + notifier->stop(aprp_cpu_index()); 792 815 793 816 release_progmem(v->load_addr); 794 817 cleanup_tc(get_tc(aprp_cpu_index())); ··· 797 820 /* this of-course trashes what was there before... */ 798 821 v->pbuffer = vmalloc(P_SIZE); 799 822 if (!v->pbuffer) { 800 - pr_warning("VPE loader: unable to allocate memory\n"); 823 + pr_warn("VPE loader: unable to allocate memory\n"); 801 824 return -ENOMEM; 802 825 } 803 826 v->plen = P_SIZE; ··· 810 833 v->cwd[0] = 0; 811 834 ret = getcwd(v->cwd, VPE_PATH_MAX); 812 835 if (ret < 0) 813 - printk(KERN_WARNING "VPE loader: open, getcwd returned %d\n", ret); 836 + pr_warn("VPE loader: open, getcwd returned %d\n", ret); 814 837 815 838 v->shared_ptr = NULL; 816 839 v->__start = 0; ··· 833 856 if ((vpe_elfload(v) >= 0) && vpe_run) { 834 857 vpe_run(v); 835 858 } else { 836 - printk(KERN_WARNING "VPE loader: ELF load failed.\n"); 859 + pr_warn("VPE loader: ELF load failed.\n"); 837 860 ret = -ENOEXEC; 838 861 } 839 862 } else { 840 - printk(KERN_WARNING "VPE loader: only elf files are supported\n"); 863 + pr_warn("VPE loader: only elf files are supported\n"); 841 864 ret = -ENOEXEC; 842 865 } 843 866 ··· 855 878 return ret; 856 879 } 857 880 858 - static ssize_t vpe_write(struct file *file, const char __user * buffer, 859 - size_t count, loff_t * ppos) 881 + static ssize_t vpe_write(struct file *file, const char __user *buffer, 882 + size_t count, loff_t *ppos) 860 883 { 861 884 size_t ret = count; 862 885 struct vpe *v; ··· 865 888 return -ENODEV; 866 889 867 890 v = get_vpe(aprp_cpu_index()); 891 + 868 892 if (v == NULL) 869 893 return -ENODEV; 870 894 871 895 if ((count + v->len) > v->plen) { 872 - printk(KERN_WARNING 873 - "VPE loader: elf size too big. Perhaps strip uneeded symbols\n"); 896 + pr_warn("VPE loader: elf size too big. Perhaps strip uneeded symbols\n"); 874 897 return -ENOMEM; 875 898 } 876 899 ··· 892 915 893 916 void *vpe_get_shared(int index) 894 917 { 895 - struct vpe *v; 918 + struct vpe *v = get_vpe(index); 896 919 897 - if ((v = get_vpe(index)) == NULL) 920 + if (v == NULL) 898 921 return NULL; 899 922 900 923 return v->shared_ptr; 901 924 } 902 - 903 925 EXPORT_SYMBOL(vpe_get_shared); 904 926 905 927 int vpe_getuid(int index) 906 928 { 907 - struct vpe *v; 929 + struct vpe *v = get_vpe(index); 908 930 909 - if ((v = get_vpe(index)) == NULL) 931 + if (v == NULL) 910 932 return -1; 911 933 912 934 return v->uid; 913 935 } 914 - 915 936 EXPORT_SYMBOL(vpe_getuid); 916 937 917 938 int vpe_getgid(int index) 918 939 { 919 - struct vpe *v; 940 + struct vpe *v = get_vpe(index); 920 941 921 - if ((v = get_vpe(index)) == NULL) 942 + if (v == NULL) 922 943 return -1; 923 944 924 945 return v->gid; 925 946 } 926 - 927 947 EXPORT_SYMBOL(vpe_getgid); 928 948 929 949 int vpe_notify(int index, struct vpe_notifications *notify) 930 950 { 931 - struct vpe *v; 951 + struct vpe *v = get_vpe(index); 932 952 933 - if ((v = get_vpe(index)) == NULL) 953 + if (v == NULL) 934 954 return -1; 935 955 936 956 list_add(&notify->list, &v->notify); 937 957 return 0; 938 958 } 939 - 940 959 EXPORT_SYMBOL(vpe_notify); 941 960 942 961 char *vpe_getcwd(int index) 943 962 { 944 - struct vpe *v; 963 + struct vpe *v = get_vpe(index); 945 964 946 - if ((v = get_vpe(index)) == NULL) 965 + if (v == NULL) 947 966 return NULL; 948 967 949 968 return v->cwd; 950 969 } 951 - 952 970 EXPORT_SYMBOL(vpe_getcwd); 953 971 954 972 module_init(vpe_module_init);
+7 -17
arch/mips/mti-malta/malta-amon.c
··· 1 1 /* 2 - * Copyright (C) 2007 MIPS Technologies, Inc. 3 - * All rights reserved. 4 - 5 - * This program is free software; you can distribute it and/or modify it 6 - * under the terms of the GNU General Public License (Version 2) as 7 - * published by the Free Software Foundation. 2 + * This file is subject to the terms and conditions of the GNU General Public 3 + * License. See the file "COPYING" in the main directory of this archive 4 + * for more details. 8 5 * 9 - * This program is distributed in the hope it will be useful, but WITHOUT 10 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 - * for more details. 6 + * Copyright (C) 2007 MIPS Technologies, Inc. All rights reserved. 7 + * Copyright (C) 2013 Imagination Technologies Ltd. 13 8 * 14 - * You should have received a copy of the GNU General Public License along 15 - * with this program; if not, write to the Free Software Foundation, Inc., 16 - * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. 17 - * 18 - * Arbitrary Monitor interface 9 + * Arbitrary Monitor Interface 19 10 */ 20 - 21 11 #include <linux/kernel.h> 22 12 #include <linux/init.h> 23 13 #include <linux/smp.h> 24 14 25 15 #include <asm/addrspace.h> 26 - #include <asm/mips-boards/launch.h> 27 16 #include <asm/mipsmtregs.h> 17 + #include <asm/mips-boards/launch.h> 28 18 #include <asm/vpe.h> 29 19 30 20 int amon_cpu_avail(int cpu)
+56 -59
arch/mips/mti-malta/malta-int.c
··· 1 1 /* 2 + * This file is subject to the terms and conditions of the GNU General Public 3 + * License. See the file "COPYING" in the main directory of this archive 4 + * for more details. 5 + * 2 6 * Carsten Langgaard, carstenl@mips.com 3 7 * Copyright (C) 2000, 2001, 2004 MIPS Technologies, Inc. 4 8 * Copyright (C) 2001 Ralf Baechle 5 9 * Copyright (C) 2013 Imagination Technologies Ltd. 6 10 * 7 - * This program is free software; you can distribute it and/or modify it 8 - * under the terms of the GNU General Public License (Version 2) as 9 - * published by the Free Software Foundation. 10 - * 11 - * This program is distributed in the hope it will be useful, but WITHOUT 12 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 - * for more details. 15 - * 16 - * You should have received a copy of the GNU General Public License along 17 - * with this program; if not, write to the Free Software Foundation, Inc., 18 - * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. 19 - * 20 11 * Routines for generic manipulation of the interrupts found on the MIPS 21 - * Malta board. 22 - * The interrupt controller is located in the South Bridge a PIIX4 device 23 - * with two internal 82C95 interrupt controllers. 12 + * Malta board. The interrupt controller is located in the South Bridge 13 + * a PIIX4 device with two internal 82C95 interrupt controllers. 24 14 */ 25 15 #include <linux/init.h> 26 16 #include <linux/irq.h> ··· 82 92 BONITO_PCIMAP_CFG = 0; 83 93 break; 84 94 default: 85 - printk(KERN_WARNING "Unknown system controller.\n"); 95 + pr_emerg("Unknown system controller.\n"); 86 96 return -1; 87 97 } 88 98 return irq; ··· 146 156 unsigned int intrcause, datalo, datahi; 147 157 struct pt_regs *regs = get_irq_regs(); 148 158 149 - printk(KERN_EMERG "CoreHI interrupt, shouldn't happen, we die here!\n"); 150 - printk(KERN_EMERG "epc : %08lx\nStatus: %08lx\n" 151 - "Cause : %08lx\nbadVaddr : %08lx\n", 152 - regs->cp0_epc, regs->cp0_status, 153 - regs->cp0_cause, regs->cp0_badvaddr); 159 + pr_emerg("CoreHI interrupt, shouldn't happen, we die here!\n"); 160 + pr_emerg("epc : %08lx\nStatus: %08lx\n" 161 + "Cause : %08lx\nbadVaddr : %08lx\n", 162 + regs->cp0_epc, regs->cp0_status, 163 + regs->cp0_cause, regs->cp0_badvaddr); 154 164 155 165 /* Read all the registers and then print them as there is a 156 166 problem with interspersed printk's upsetting the Bonito controller. ··· 168 178 intrcause = GT_READ(GT_INTRCAUSE_OFS); 169 179 datalo = GT_READ(GT_CPUERR_ADDRLO_OFS); 170 180 datahi = GT_READ(GT_CPUERR_ADDRHI_OFS); 171 - printk(KERN_EMERG "GT_INTRCAUSE = %08x\n", intrcause); 172 - printk(KERN_EMERG "GT_CPUERR_ADDR = %02x%08x\n", 181 + pr_emerg("GT_INTRCAUSE = %08x\n", intrcause); 182 + pr_emerg("GT_CPUERR_ADDR = %02x%08x\n", 173 183 datahi, datalo); 174 184 break; 175 185 case MIPS_REVISION_SCON_BONITO: ··· 181 191 intedge = BONITO_INTEDGE; 182 192 intsteer = BONITO_INTSTEER; 183 193 pcicmd = BONITO_PCICMD; 184 - printk(KERN_EMERG "BONITO_INTISR = %08x\n", intisr); 185 - printk(KERN_EMERG "BONITO_INTEN = %08x\n", inten); 186 - printk(KERN_EMERG "BONITO_INTPOL = %08x\n", intpol); 187 - printk(KERN_EMERG "BONITO_INTEDGE = %08x\n", intedge); 188 - printk(KERN_EMERG "BONITO_INTSTEER = %08x\n", intsteer); 189 - printk(KERN_EMERG "BONITO_PCICMD = %08x\n", pcicmd); 190 - printk(KERN_EMERG "BONITO_PCIBADADDR = %08x\n", pcibadaddr); 191 - printk(KERN_EMERG "BONITO_PCIMSTAT = %08x\n", pcimstat); 194 + pr_emerg("BONITO_INTISR = %08x\n", intisr); 195 + pr_emerg("BONITO_INTEN = %08x\n", inten); 196 + pr_emerg("BONITO_INTPOL = %08x\n", intpol); 197 + pr_emerg("BONITO_INTEDGE = %08x\n", intedge); 198 + pr_emerg("BONITO_INTSTEER = %08x\n", intsteer); 199 + pr_emerg("BONITO_PCICMD = %08x\n", pcicmd); 200 + pr_emerg("BONITO_PCIBADADDR = %08x\n", pcibadaddr); 201 + pr_emerg("BONITO_PCIMSTAT = %08x\n", pcimstat); 192 202 break; 193 203 } 194 204 ··· 367 377 .flags = IRQF_NO_THREAD, 368 378 }; 369 379 370 - static msc_irqmap_t __initdata msc_irqmap[] = { 380 + static msc_irqmap_t msc_irqmap[] __initdata = { 371 381 {MSC01C_INT_TMR, MSC01_IRQ_EDGE, 0}, 372 382 {MSC01C_INT_PCI, MSC01_IRQ_LEVEL, 0}, 373 383 }; 374 - static int __initdata msc_nr_irqs = ARRAY_SIZE(msc_irqmap); 384 + static int msc_nr_irqs __initdata = ARRAY_SIZE(msc_irqmap); 375 385 376 - static msc_irqmap_t __initdata msc_eicirqmap[] = { 386 + static msc_irqmap_t msc_eicirqmap[] __initdata = { 377 387 {MSC01E_INT_SW0, MSC01_IRQ_LEVEL, 0}, 378 388 {MSC01E_INT_SW1, MSC01_IRQ_LEVEL, 0}, 379 389 {MSC01E_INT_I8259A, MSC01_IRQ_LEVEL, 0}, ··· 386 396 {MSC01E_INT_CPUCTR, MSC01_IRQ_LEVEL, 0} 387 397 }; 388 398 389 - static int __initdata msc_nr_eicirqs = ARRAY_SIZE(msc_eicirqmap); 399 + static int msc_nr_eicirqs __initdata = ARRAY_SIZE(msc_eicirqmap); 390 400 391 401 /* 392 402 * This GIC specific tabular array defines the association between External ··· 433 443 if (gcmp_present >= 0) 434 444 return gcmp_present; 435 445 436 - _gcmp_base = (unsigned long) ioremap_nocache(GCMP_BASE_ADDR, GCMP_ADDRSPACE_SZ); 437 - _msc01_biu_base = (unsigned long) ioremap_nocache(MSC01_BIU_REG_BASE, MSC01_BIU_ADDRSPACE_SZ); 438 - gcmp_present = (GCMPGCB(GCMPB) & GCMP_GCB_GCMPB_GCMPBASE_MSK) == GCMP_BASE_ADDR; 446 + _gcmp_base = (unsigned long) ioremap_nocache(GCMP_BASE_ADDR, 447 + GCMP_ADDRSPACE_SZ); 448 + _msc01_biu_base = (unsigned long) ioremap_nocache(MSC01_BIU_REG_BASE, 449 + MSC01_BIU_ADDRSPACE_SZ); 450 + gcmp_present = ((GCMPGCB(GCMPB) & GCMP_GCB_GCMPB_GCMPBASE_MSK) == 451 + GCMP_BASE_ADDR); 439 452 440 453 if (gcmp_present) 441 454 pr_debug("GCMP present\n"); ··· 448 455 /* Return the number of IOCU's present */ 449 456 int __init gcmp_niocu(void) 450 457 { 451 - return gcmp_present ? 452 - (GCMPGCB(GC) & GCMP_GCB_GC_NUMIOCU_MSK) >> GCMP_GCB_GC_NUMIOCU_SHF : 453 - 0; 458 + return gcmp_present ? ((GCMPGCB(GC) & GCMP_GCB_GC_NUMIOCU_MSK) >> 459 + GCMP_GCB_GC_NUMIOCU_SHF) : 0; 454 460 } 455 461 456 462 /* Set GCMP region attributes */ ··· 598 606 set_vi_handler(MIPSCPU_INT_IPI1, malta_ipi_irqdispatch); 599 607 } 600 608 /* Argh.. this really needs sorting out.. */ 601 - printk("CPU%d: status register was %08x\n", smp_processor_id(), read_c0_status()); 609 + pr_info("CPU%d: status register was %08x\n", 610 + smp_processor_id(), read_c0_status()); 602 611 write_c0_status(read_c0_status() | STATUSF_IP3 | STATUSF_IP4); 603 - printk("CPU%d: status register now %08x\n", smp_processor_id(), read_c0_status()); 612 + pr_info("CPU%d: status register now %08x\n", 613 + smp_processor_id(), read_c0_status()); 604 614 write_c0_status(0x1100dc00); 605 - printk("CPU%d: status register frc %08x\n", smp_processor_id(), read_c0_status()); 615 + pr_info("CPU%d: status register frc %08x\n", 616 + smp_processor_id(), read_c0_status()); 606 617 for (i = 0; i < nr_cpu_ids; i++) { 607 618 arch_init_ipiirq(MIPS_GIC_IRQ_BASE + 608 619 GIC_RESCHED_INT(i), &irq_resched); ··· 623 628 cpu_ipi_call_irq = MSC01E_INT_SW1; 624 629 } else { 625 630 if (cpu_has_vint) { 626 - set_vi_handler (MIPS_CPU_IPI_RESCHED_IRQ, ipi_resched_dispatch); 627 - set_vi_handler (MIPS_CPU_IPI_CALL_IRQ, ipi_call_dispatch); 631 + set_vi_handler (MIPS_CPU_IPI_RESCHED_IRQ, 632 + ipi_resched_dispatch); 633 + set_vi_handler (MIPS_CPU_IPI_CALL_IRQ, 634 + ipi_call_dispatch); 628 635 } 629 - cpu_ipi_resched_irq = MIPS_CPU_IRQ_BASE + MIPS_CPU_IPI_RESCHED_IRQ; 630 - cpu_ipi_call_irq = MIPS_CPU_IRQ_BASE + MIPS_CPU_IPI_CALL_IRQ; 636 + cpu_ipi_resched_irq = MIPS_CPU_IRQ_BASE + 637 + MIPS_CPU_IPI_RESCHED_IRQ; 638 + cpu_ipi_call_irq = MIPS_CPU_IRQ_BASE + 639 + MIPS_CPU_IPI_CALL_IRQ; 631 640 } 632 641 arch_init_ipiirq(cpu_ipi_resched_irq, &irq_resched); 633 642 arch_init_ipiirq(cpu_ipi_call_irq, &irq_call); ··· 641 642 642 643 void malta_be_init(void) 643 644 { 644 - if (gcmp_present) { 645 - /* Could change CM error mask register */ 646 - } 645 + /* Could change CM error mask register. */ 647 646 } 648 647 649 648 ··· 721 724 if (cause < 16) { 722 725 unsigned long cca_bits = (cm_error >> 15) & 7; 723 726 unsigned long tr_bits = (cm_error >> 12) & 7; 724 - unsigned long mcmd_bits = (cm_error >> 7) & 0x1f; 727 + unsigned long cmd_bits = (cm_error >> 7) & 0x1f; 725 728 unsigned long stag_bits = (cm_error >> 3) & 15; 726 729 unsigned long sport_bits = (cm_error >> 0) & 7; 727 730 728 731 snprintf(buf, sizeof(buf), 729 732 "CCA=%lu TR=%s MCmd=%s STag=%lu " 730 733 "SPort=%lu\n", 731 - cca_bits, tr[tr_bits], mcmd[mcmd_bits], 734 + cca_bits, tr[tr_bits], mcmd[cmd_bits], 732 735 stag_bits, sport_bits); 733 736 } else { 734 737 /* glob state & sresp together */ ··· 737 740 unsigned long c1_bits = (cm_error >> 12) & 7; 738 741 unsigned long c0_bits = (cm_error >> 9) & 7; 739 742 unsigned long sc_bit = (cm_error >> 8) & 1; 740 - unsigned long mcmd_bits = (cm_error >> 3) & 0x1f; 743 + unsigned long cmd_bits = (cm_error >> 3) & 0x1f; 741 744 unsigned long sport_bits = (cm_error >> 0) & 7; 742 745 snprintf(buf, sizeof(buf), 743 746 "C3=%s C2=%s C1=%s C0=%s SC=%s " ··· 745 748 core[c3_bits], core[c2_bits], 746 749 core[c1_bits], core[c0_bits], 747 750 sc_bit ? "True" : "False", 748 - mcmd[mcmd_bits], sport_bits); 751 + mcmd[cmd_bits], sport_bits); 749 752 } 750 753 751 754 ocause = (cm_other & GCMP_GCB_GMEO_ERROR_2ND_MSK) >> 752 755 GCMP_GCB_GMEO_ERROR_2ND_SHF; 753 756 754 - printk("CM_ERROR=%08lx %s <%s>\n", cm_error, 757 + pr_err("CM_ERROR=%08lx %s <%s>\n", cm_error, 755 758 causes[cause], buf); 756 - printk("CM_ADDR =%08lx\n", cm_addr); 757 - printk("CM_OTHER=%08lx %s\n", cm_other, causes[ocause]); 759 + pr_err("CM_ADDR =%08lx\n", cm_addr); 760 + pr_err("CM_OTHER=%08lx %s\n", cm_other, causes[ocause]); 758 761 759 762 /* reprime cause register */ 760 763 GCMPGCB(GCMEC) = 0;