diff options
author | Arnd Bergmann <arnd@arndb.de> | 2009-06-27 08:46:35 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2009-06-27 09:16:16 -0400 |
commit | c6067472252c1d6155c7c01c93e0d580342cdb29 (patch) | |
tree | 985a0fdf5342bc6e73245bb4553e64e404cd9e48 /arch/score | |
parent | bddc605955bca2d914ca621a7ef4ca6c271f55d8 (diff) |
score: cleanups: dead code, 0 as pointer, shadowed variables
A few smaller issues found by sparse, some code that was
never used, two instances of '0' instead of 'NULL' and
local variables shadowing another one.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/score')
-rw-r--r-- | arch/score/kernel/module.c | 12 | ||||
-rw-r--r-- | arch/score/kernel/signal.c | 2 | ||||
-rw-r--r-- | arch/score/kernel/sys_score.c | 14 |
3 files changed, 8 insertions, 20 deletions
diff --git a/arch/score/kernel/module.c b/arch/score/kernel/module.c index 1a625572ecc8..4de8d47becd3 100644 --- a/arch/score/kernel/module.c +++ b/arch/score/kernel/module.c | |||
@@ -57,17 +57,17 @@ int apply_relocate(Elf_Shdr *sechdrs, const char *strtab, | |||
57 | for (i = 0; i < relsec->sh_size / sizeof(Elf32_Rel); i++, rel++) { | 57 | for (i = 0; i < relsec->sh_size / sizeof(Elf32_Rel); i++, rel++) { |
58 | unsigned long loc; | 58 | unsigned long loc; |
59 | Elf32_Sym *sym; | 59 | Elf32_Sym *sym; |
60 | s32 offset; | 60 | s32 r_offset; |
61 | 61 | ||
62 | offset = ELF32_R_SYM(rel->r_info); | 62 | r_offset = ELF32_R_SYM(rel->r_info); |
63 | if ((offset < 0) || | 63 | if ((r_offset < 0) || |
64 | (offset > (symsec->sh_size / sizeof(Elf32_Sym)))) { | 64 | (r_offset > (symsec->sh_size / sizeof(Elf32_Sym)))) { |
65 | printk(KERN_ERR "%s: bad relocation, section %d reloc %d\n", | 65 | printk(KERN_ERR "%s: bad relocation, section %d reloc %d\n", |
66 | me->name, relindex, i); | 66 | me->name, relindex, i); |
67 | return -ENOEXEC; | 67 | return -ENOEXEC; |
68 | } | 68 | } |
69 | 69 | ||
70 | sym = ((Elf32_Sym *)symsec->sh_addr) + offset; | 70 | sym = ((Elf32_Sym *)symsec->sh_addr) + r_offset; |
71 | 71 | ||
72 | if ((rel->r_offset < 0) || | 72 | if ((rel->r_offset < 0) || |
73 | (rel->r_offset > dstsec->sh_size - sizeof(u32))) { | 73 | (rel->r_offset > dstsec->sh_size - sizeof(u32))) { |
@@ -152,7 +152,7 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, | |||
152 | /* Given an address, look for it in the module exception tables. */ | 152 | /* Given an address, look for it in the module exception tables. */ |
153 | const struct exception_table_entry *search_module_dbetables(unsigned long addr) | 153 | const struct exception_table_entry *search_module_dbetables(unsigned long addr) |
154 | { | 154 | { |
155 | return 0; | 155 | return NULL; |
156 | } | 156 | } |
157 | 157 | ||
158 | /* Put in dbe list if necessary. */ | 158 | /* Put in dbe list if necessary. */ |
diff --git a/arch/score/kernel/signal.c b/arch/score/kernel/signal.c index afbfe33dcf17..950f87c4a16a 100644 --- a/arch/score/kernel/signal.c +++ b/arch/score/kernel/signal.c | |||
@@ -212,7 +212,7 @@ static int setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, | |||
212 | 212 | ||
213 | err |= copy_siginfo_to_user(&frame->rs_info, info); | 213 | err |= copy_siginfo_to_user(&frame->rs_info, info); |
214 | err |= __put_user(0, &frame->rs_uc.uc_flags); | 214 | err |= __put_user(0, &frame->rs_uc.uc_flags); |
215 | err |= __put_user(0, &frame->rs_uc.uc_link); | 215 | err |= __put_user(NULL, &frame->rs_uc.uc_link); |
216 | err |= __put_user((void __user *)current->sas_ss_sp, | 216 | err |= __put_user((void __user *)current->sas_ss_sp, |
217 | &frame->rs_uc.uc_stack.ss_sp); | 217 | &frame->rs_uc.uc_stack.ss_sp); |
218 | err |= __put_user(sas_ss_flags(regs->regs[0]), | 218 | err |= __put_user(sas_ss_flags(regs->regs[0]), |
diff --git a/arch/score/kernel/sys_score.c b/arch/score/kernel/sys_score.c index 5b3cc4e685ae..61aff8a93443 100644 --- a/arch/score/kernel/sys_score.c +++ b/arch/score/kernel/sys_score.c | |||
@@ -31,10 +31,7 @@ | |||
31 | #include <linux/syscalls.h> | 31 | #include <linux/syscalls.h> |
32 | #include <asm/syscalls.h> | 32 | #include <asm/syscalls.h> |
33 | 33 | ||
34 | unsigned long shm_align_mask = PAGE_SIZE - 1; | 34 | asmlinkage long |
35 | EXPORT_SYMBOL(shm_align_mask); | ||
36 | |||
37 | asmlinkage unsigned | ||
38 | sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, | 35 | sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, |
39 | unsigned long flags, unsigned long fd, unsigned long pgoff) | 36 | unsigned long flags, unsigned long fd, unsigned long pgoff) |
40 | { | 37 | { |
@@ -107,15 +104,6 @@ score_execve(struct pt_regs *regs) | |||
107 | } | 104 | } |
108 | 105 | ||
109 | /* | 106 | /* |
110 | * If we ever come here the user sp is bad. Zap the process right away. | ||
111 | * Due to the bad stack signaling wouldn't work. | ||
112 | */ | ||
113 | void bad_stack(void) | ||
114 | { | ||
115 | do_exit(SIGSEGV); | ||
116 | } | ||
117 | |||
118 | /* | ||
119 | * Do a system call from kernel instead of calling sys_execve so we | 107 | * Do a system call from kernel instead of calling sys_execve so we |
120 | * end up with proper pt_regs. | 108 | * end up with proper pt_regs. |
121 | */ | 109 | */ |