提交 959ed340 编写于 作者: E Eric Biederman 提交者: Linus Torvalds

[PATCH] Fix conflict with the is_init identifier on parisc

This appears to be the only usage of is_init in the kernel besides the
usage in sched.h.  On ia64 the same function is called in_init.  So to
remove the conflict and make the kernel more consistent rename is_init
is_core is_local and is_local_section to in_init in_core in_local and
in_local_section respectively.

Thanks to Adrian Bunk who spotted this, and to Matthew Wilcox
who suggested this fix.
Signed-off-by: NEric Biederman <ebiederm@xmission.com>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Matthew Wilcox <willy@debian.org>
Cc: Adrian Bunk <bunk@stusta.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 3b9b8ab6
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
* - SEGREL32 handling * - SEGREL32 handling
* We are not doing SEGREL32 handling correctly. According to the ABI, we * We are not doing SEGREL32 handling correctly. According to the ABI, we
* should do a value offset, like this: * should do a value offset, like this:
* if (is_init(me, (void *)val)) * if (in_init(me, (void *)val))
* val -= (uint32_t)me->module_init; * val -= (uint32_t)me->module_init;
* else * else
* val -= (uint32_t)me->module_core; * val -= (uint32_t)me->module_core;
...@@ -72,27 +72,27 @@ ...@@ -72,27 +72,27 @@
/* three functions to determine where in the module core /* three functions to determine where in the module core
* or init pieces the location is */ * or init pieces the location is */
static inline int is_init(struct module *me, void *loc) static inline int in_init(struct module *me, void *loc)
{ {
return (loc >= me->module_init && return (loc >= me->module_init &&
loc <= (me->module_init + me->init_size)); loc <= (me->module_init + me->init_size));
} }
static inline int is_core(struct module *me, void *loc) static inline int in_core(struct module *me, void *loc)
{ {
return (loc >= me->module_core && return (loc >= me->module_core &&
loc <= (me->module_core + me->core_size)); loc <= (me->module_core + me->core_size));
} }
static inline int is_local(struct module *me, void *loc) static inline int in_local(struct module *me, void *loc)
{ {
return is_init(me, loc) || is_core(me, loc); return in_init(me, loc) || in_core(me, loc);
} }
static inline int is_local_section(struct module *me, void *loc, void *dot) static inline int in_local_section(struct module *me, void *loc, void *dot)
{ {
return (is_init(me, loc) && is_init(me, dot)) || return (in_init(me, loc) && in_init(me, dot)) ||
(is_core(me, loc) && is_core(me, dot)); (in_core(me, loc) && in_core(me, dot));
} }
...@@ -566,14 +566,14 @@ int apply_relocate_add(Elf_Shdr *sechdrs, ...@@ -566,14 +566,14 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
break; break;
case R_PARISC_PCREL17F: case R_PARISC_PCREL17F:
/* 17-bit PC relative address */ /* 17-bit PC relative address */
val = get_stub(me, val, addend, ELF_STUB_GOT, is_init(me, loc)); val = get_stub(me, val, addend, ELF_STUB_GOT, in_init(me, loc));
val = (val - dot - 8)/4; val = (val - dot - 8)/4;
CHECK_RELOC(val, 17) CHECK_RELOC(val, 17)
*loc = (*loc & ~0x1f1ffd) | reassemble_17(val); *loc = (*loc & ~0x1f1ffd) | reassemble_17(val);
break; break;
case R_PARISC_PCREL22F: case R_PARISC_PCREL22F:
/* 22-bit PC relative address; only defined for pa20 */ /* 22-bit PC relative address; only defined for pa20 */
val = get_stub(me, val, addend, ELF_STUB_GOT, is_init(me, loc)); val = get_stub(me, val, addend, ELF_STUB_GOT, in_init(me, loc));
DEBUGP("STUB FOR %s loc %lx+%lx at %lx\n", DEBUGP("STUB FOR %s loc %lx+%lx at %lx\n",
strtab + sym->st_name, (unsigned long)loc, addend, strtab + sym->st_name, (unsigned long)loc, addend,
val) val)
...@@ -670,9 +670,9 @@ int apply_relocate_add(Elf_Shdr *sechdrs, ...@@ -670,9 +670,9 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
strtab + sym->st_name, strtab + sym->st_name,
loc, val); loc, val);
/* can we reach it locally? */ /* can we reach it locally? */
if(!is_local_section(me, (void *)val, (void *)dot)) { if(!in_local_section(me, (void *)val, (void *)dot)) {
if (is_local(me, (void *)val)) if (in_local(me, (void *)val))
/* this is the case where the /* this is the case where the
* symbol is local to the * symbol is local to the
* module, but in a different * module, but in a different
...@@ -680,14 +680,14 @@ int apply_relocate_add(Elf_Shdr *sechdrs, ...@@ -680,14 +680,14 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
* in case it's more than 22 * in case it's more than 22
* bits away */ * bits away */
val = get_stub(me, val, addend, ELF_STUB_DIRECT, val = get_stub(me, val, addend, ELF_STUB_DIRECT,
is_init(me, loc)); in_init(me, loc));
else if (strncmp(strtab + sym->st_name, "$$", 2) else if (strncmp(strtab + sym->st_name, "$$", 2)
== 0) == 0)
val = get_stub(me, val, addend, ELF_STUB_MILLI, val = get_stub(me, val, addend, ELF_STUB_MILLI,
is_init(me, loc)); in_init(me, loc));
else else
val = get_stub(me, val, addend, ELF_STUB_GOT, val = get_stub(me, val, addend, ELF_STUB_GOT,
is_init(me, loc)); in_init(me, loc));
} }
DEBUGP("STUB FOR %s loc %lx, val %lx+%lx at %lx\n", DEBUGP("STUB FOR %s loc %lx, val %lx+%lx at %lx\n",
strtab + sym->st_name, loc, sym->st_value, strtab + sym->st_name, loc, sym->st_value,
...@@ -720,7 +720,7 @@ int apply_relocate_add(Elf_Shdr *sechdrs, ...@@ -720,7 +720,7 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
break; break;
case R_PARISC_FPTR64: case R_PARISC_FPTR64:
/* 64-bit function address */ /* 64-bit function address */
if(is_local(me, (void *)(val + addend))) { if(in_local(me, (void *)(val + addend))) {
*loc64 = get_fdesc(me, val+addend); *loc64 = get_fdesc(me, val+addend);
DEBUGP("FDESC for %s at %p points to %lx\n", DEBUGP("FDESC for %s at %p points to %lx\n",
strtab + sym->st_name, *loc64, strtab + sym->st_name, *loc64,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册