Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ae84e324709d6320ed8c1fd7b1736fcbaf26df95
Commit:     ae84e324709d6320ed8c1fd7b1736fcbaf26df95
Parent:     55955aad7c09e4d93029d0cf2d360b41891f2fe4
Author:     Alexey Dobriyan <[EMAIL PROTECTED]>
AuthorDate: Tue May 8 00:28:38 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 8 11:15:08 2007 -0700

    Simplify module_get_kallsym() by dropping length arg
    
    module_get_kallsym() could in theory truncate module symbol name to fit in
    buffer, but nobody does this.  Always use KSYM_NAME_LEN + 1 bytes for name.
    
    Suggested by lg^WRusty.
    
    Signed-off-by: Alexey Dobriyan <[EMAIL PROTECTED]>
    Acked-by: Rusty Russell <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 include/linux/module.h |    5 ++---
 kernel/kallsyms.c      |    2 +-
 kernel/module.c        |    5 +++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/module.h b/include/linux/module.h
index f0b0faf..7999302 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -373,7 +373,7 @@ int is_module_address(unsigned long addr);
 /* Returns module and fills in value, defined and namebuf, or NULL if
    symnum out of range. */
 struct module *module_get_kallsym(unsigned int symnum, unsigned long *value,
-                               char *type, char *name, size_t namelen);
+                               char *type, char *name);
 
 /* Look for this name: can be of form module:name. */
 unsigned long module_kallsyms_lookup_name(const char *name);
@@ -529,8 +529,7 @@ static inline const char *module_address_lookup(unsigned 
long addr,
 
 static inline struct module *module_get_kallsym(unsigned int symnum,
                                                unsigned long *value,
-                                               char *type, char *name,
-                                               size_t namelen)
+                                               char *type, char *name)
 {
        return NULL;
 }
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index 5a0de84..d086c91 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -312,7 +312,7 @@ static int get_ksymbol_mod(struct kallsym_iter *iter)
 {
        iter->owner = module_get_kallsym(iter->pos - kallsyms_num_syms,
                                         &iter->value, &iter->type,
-                                        iter->name, sizeof(iter->name));
+                                        iter->name);
        if (iter->owner == NULL)
                return 0;
 
diff --git a/kernel/module.c b/kernel/module.c
index 9bdbd12..43a529a 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -19,6 +19,7 @@
 #include <linux/module.h>
 #include <linux/moduleloader.h>
 #include <linux/init.h>
+#include <linux/kallsyms.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
@@ -2124,7 +2125,7 @@ const char *module_address_lookup(unsigned long addr,
 }
 
 struct module *module_get_kallsym(unsigned int symnum, unsigned long *value,
-                               char *type, char *name, size_t namelen)
+                               char *type, char *name)
 {
        struct module *mod;
 
@@ -2134,7 +2135,7 @@ struct module *module_get_kallsym(unsigned int symnum, 
unsigned long *value,
                        *value = mod->symtab[symnum].st_value;
                        *type = mod->symtab[symnum].st_info;
                        strlcpy(name, mod->strtab + mod->symtab[symnum].st_name,
-                               namelen);
+                               KSYM_NAME_LEN + 1);
                        mutex_unlock(&module_mutex);
                        return mod;
                }
-
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