Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=92dfc9dc7ba63134f721b6e745dbdcfc13ea341b
Commit:     92dfc9dc7ba63134f721b6e745dbdcfc13ea341b
Parent:     6d7623943c905efae327933bc5ee0b2f78e15f56
Author:     Andrew Morton <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 8 04:18:43 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri Feb 8 09:22:24 2008 -0800

    fix "modules: make module_address_lookup() safe"
    
    Get the constness right, avoid nasty cast.
    
    Cc: Ingo Molnar <[EMAIL PROTECTED]>
    Cc: Kyle McMartin <[EMAIL PROTECTED]>
    Cc: Rusty Russell <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 include/linux/module.h |    4 ++--
 kernel/module.c        |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/module.h b/include/linux/module.h
index ac481e2..ac28e87 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -449,7 +449,7 @@ static inline void __module_get(struct module *module)
 /* For kallsyms to ask for address resolution.  namebuf should be at
  * least KSYM_NAME_LEN long: a pointer to namebuf is returned if
  * found, otherwise NULL. */
-char *module_address_lookup(unsigned long addr,
+const char *module_address_lookup(unsigned long addr,
                            unsigned long *symbolsize,
                            unsigned long *offset,
                            char **modname,
@@ -519,7 +519,7 @@ static inline void module_put(struct module *module)
 #define module_name(mod) "kernel"
 
 /* For kallsyms to ask for address resolution.  NULL means not found. */
-static inline char *module_address_lookup(unsigned long addr,
+static inline const char *module_address_lookup(unsigned long addr,
                                          unsigned long *symbolsize,
                                          unsigned long *offset,
                                          char **modname,
diff --git a/kernel/module.c b/kernel/module.c
index 676c023..4202da9 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2253,7 +2253,7 @@ static const char *get_ksymbol(struct module *mod,
 
 /* For kallsyms to ask for address resolution.  NULL means not found.  Careful
  * not to lock to avoid deadlock on oopses, simply disable preemption. */
-char *module_address_lookup(unsigned long addr,
+const char *module_address_lookup(unsigned long addr,
                            unsigned long *size,
                            unsigned long *offset,
                            char **modname,
@@ -2278,7 +2278,7 @@ char *module_address_lookup(unsigned long addr,
                ret = namebuf;
        }
        preempt_enable();
-       return (char *)ret;
+       return ret;
 }
 
 int lookup_module_symbol_name(unsigned long addr, char *symname)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to