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>
This commit is contained in:
parent
bddc605955
commit
c606747225
|
@ -57,17 +57,17 @@ int apply_relocate(Elf_Shdr *sechdrs, const char *strtab,
|
||||||
for (i = 0; i < relsec->sh_size / sizeof(Elf32_Rel); i++, rel++) {
|
for (i = 0; i < relsec->sh_size / sizeof(Elf32_Rel); i++, rel++) {
|
||||||
unsigned long loc;
|
unsigned long loc;
|
||||||
Elf32_Sym *sym;
|
Elf32_Sym *sym;
|
||||||
s32 offset;
|
s32 r_offset;
|
||||||
|
|
||||||
offset = ELF32_R_SYM(rel->r_info);
|
r_offset = ELF32_R_SYM(rel->r_info);
|
||||||
if ((offset < 0) ||
|
if ((r_offset < 0) ||
|
||||||
(offset > (symsec->sh_size / sizeof(Elf32_Sym)))) {
|
(r_offset > (symsec->sh_size / sizeof(Elf32_Sym)))) {
|
||||||
printk(KERN_ERR "%s: bad relocation, section %d reloc %d\n",
|
printk(KERN_ERR "%s: bad relocation, section %d reloc %d\n",
|
||||||
me->name, relindex, i);
|
me->name, relindex, i);
|
||||||
return -ENOEXEC;
|
return -ENOEXEC;
|
||||||
}
|
}
|
||||||
|
|
||||||
sym = ((Elf32_Sym *)symsec->sh_addr) + offset;
|
sym = ((Elf32_Sym *)symsec->sh_addr) + r_offset;
|
||||||
|
|
||||||
if ((rel->r_offset < 0) ||
|
if ((rel->r_offset < 0) ||
|
||||||
(rel->r_offset > dstsec->sh_size - sizeof(u32))) {
|
(rel->r_offset > dstsec->sh_size - sizeof(u32))) {
|
||||||
|
@ -152,7 +152,7 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
|
||||||
/* Given an address, look for it in the module exception tables. */
|
/* Given an address, look for it in the module exception tables. */
|
||||||
const struct exception_table_entry *search_module_dbetables(unsigned long addr)
|
const struct exception_table_entry *search_module_dbetables(unsigned long addr)
|
||||||
{
|
{
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Put in dbe list if necessary. */
|
/* Put in dbe list if necessary. */
|
||||||
|
|
|
@ -212,7 +212,7 @@ static int setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs,
|
||||||
|
|
||||||
err |= copy_siginfo_to_user(&frame->rs_info, info);
|
err |= copy_siginfo_to_user(&frame->rs_info, info);
|
||||||
err |= __put_user(0, &frame->rs_uc.uc_flags);
|
err |= __put_user(0, &frame->rs_uc.uc_flags);
|
||||||
err |= __put_user(0, &frame->rs_uc.uc_link);
|
err |= __put_user(NULL, &frame->rs_uc.uc_link);
|
||||||
err |= __put_user((void __user *)current->sas_ss_sp,
|
err |= __put_user((void __user *)current->sas_ss_sp,
|
||||||
&frame->rs_uc.uc_stack.ss_sp);
|
&frame->rs_uc.uc_stack.ss_sp);
|
||||||
err |= __put_user(sas_ss_flags(regs->regs[0]),
|
err |= __put_user(sas_ss_flags(regs->regs[0]),
|
||||||
|
|
|
@ -31,10 +31,7 @@
|
||||||
#include <linux/syscalls.h>
|
#include <linux/syscalls.h>
|
||||||
#include <asm/syscalls.h>
|
#include <asm/syscalls.h>
|
||||||
|
|
||||||
unsigned long shm_align_mask = PAGE_SIZE - 1;
|
asmlinkage long
|
||||||
EXPORT_SYMBOL(shm_align_mask);
|
|
||||||
|
|
||||||
asmlinkage unsigned
|
|
||||||
sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot,
|
sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot,
|
||||||
unsigned long flags, unsigned long fd, unsigned long pgoff)
|
unsigned long flags, unsigned long fd, unsigned long pgoff)
|
||||||
{
|
{
|
||||||
|
@ -106,15 +103,6 @@ score_execve(struct pt_regs *regs)
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* If we ever come here the user sp is bad. Zap the process right away.
|
|
||||||
* Due to the bad stack signaling wouldn't work.
|
|
||||||
*/
|
|
||||||
void bad_stack(void)
|
|
||||||
{
|
|
||||||
do_exit(SIGSEGV);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Do a system call from kernel instead of calling sys_execve so we
|
* Do a system call from kernel instead of calling sys_execve so we
|
||||||
* end up with proper pt_regs.
|
* end up with proper pt_regs.
|
||||||
|
|
Loading…
Reference in a new issue