Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140518
b: refs/heads/master
c: a6e6abd
h: refs/heads/master
v: v3
  • Loading branch information
Rusty Russell committed Mar 31, 2009
1 parent ffadf67 commit 4cf6090
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e610499e2656e61975affd0af56b26eb73964c84
refs/heads/master: a6e6abd575fcbe6572ebc7a70ad616406d206fa8
4 changes: 2 additions & 2 deletions trunk/drivers/mtd/nand/nand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2720,14 +2720,14 @@ int nand_scan_tail(struct mtd_info *mtd)
return chip->scan_bbt(mtd);
}

/* module_text_address() isn't exported, and it's mostly a pointless
/* is_module_text_address() isn't exported, and it's mostly a pointless
test if this is a module _anyway_ -- they'd have to try _really_ hard
to call us from in-kernel code if the core NAND support is modular. */
#ifdef MODULE
#define caller_is_module() (1)
#else
#define caller_is_module() \
module_text_address((unsigned long)__builtin_return_address(0))
is_module_text_address((unsigned long)__builtin_return_address(0))
#endif

/**
Expand Down
7 changes: 0 additions & 7 deletions trunk/include/linux/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,6 @@ static inline int module_is_live(struct module *mod)
return mod->state != MODULE_STATE_GOING;
}

/* Is this address in a module? (second is with no locks, for oops) */
struct module *module_text_address(unsigned long addr);
struct module *__module_text_address(unsigned long addr);
struct module *__module_address(unsigned long addr);
bool is_module_address(unsigned long addr);
Expand Down Expand Up @@ -496,11 +494,6 @@ search_module_extables(unsigned long addr)
return NULL;
}

static inline struct module *module_text_address(unsigned long addr)
{
return NULL;
}

static inline struct module *__module_address(unsigned long addr)
{
return NULL;
Expand Down
6 changes: 3 additions & 3 deletions trunk/kernel/extable.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ __notrace_funcgraph int __kernel_text_address(unsigned long addr)
{
if (core_kernel_text(addr))
return 1;
return __module_text_address(addr) != NULL;
return is_module_text_address(addr);
}

int kernel_text_address(unsigned long addr)
{
if (core_kernel_text(addr))
return 1;
return module_text_address(addr) != NULL;
return is_module_text_address(addr);
}

/*
Expand All @@ -81,5 +81,5 @@ int func_ptr_is_kernel_text(void *ptr)
addr = (unsigned long) dereference_function_descriptor(ptr);
if (core_kernel_text(addr))
return 1;
return module_text_address(addr) != NULL;
return is_module_text_address(addr);
}
17 changes: 4 additions & 13 deletions trunk/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -908,8 +908,10 @@ void symbol_put_addr(void *addr)
if (core_kernel_text((unsigned long)addr))
return;

if (!(modaddr = module_text_address((unsigned long)addr)))
BUG();
/* module_text_address is safe here: we're supposed to have reference
* to module from symbol_get, so it can't go away. */
modaddr = __module_text_address((unsigned long)addr);
BUG_ON(!modaddr);
module_put(modaddr);
}
EXPORT_SYMBOL_GPL(symbol_put_addr);
Expand Down Expand Up @@ -2821,17 +2823,6 @@ struct module *__module_text_address(unsigned long addr)
return mod;
}

struct module *module_text_address(unsigned long addr)
{
struct module *mod;

preempt_disable();
mod = __module_text_address(addr);
preempt_enable();

return mod;
}

/* Don't grab lock, we're oopsing. */
void print_modules(void)
{
Expand Down

0 comments on commit 4cf6090

Please sign in to comment.