aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/filesystems/sysfs.txt4
-rw-r--r--Documentation/translations/zh_CN/filesystems/sysfs.txt4
-rw-r--r--include/linux/kallsyms.h18
-rw-r--r--kernel/kallsyms.c11
4 files changed, 4 insertions, 33 deletions
diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt
index 9a3658cc399e..a1426cabcef1 100644
--- a/Documentation/filesystems/sysfs.txt
+++ b/Documentation/filesystems/sysfs.txt
@@ -154,8 +154,8 @@ static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
154 if (dev_attr->show) 154 if (dev_attr->show)
155 ret = dev_attr->show(dev, dev_attr, buf); 155 ret = dev_attr->show(dev, dev_attr, buf);
156 if (ret >= (ssize_t)PAGE_SIZE) { 156 if (ret >= (ssize_t)PAGE_SIZE) {
157 print_symbol("dev_attr_show: %s returned bad count\n", 157 printk("dev_attr_show: %pS returned bad count\n",
158 (unsigned long)dev_attr->show); 158 dev_attr->show);
159 } 159 }
160 return ret; 160 return ret;
161} 161}
diff --git a/Documentation/translations/zh_CN/filesystems/sysfs.txt b/Documentation/translations/zh_CN/filesystems/sysfs.txt
index 7d3b05edb8ce..452271dda141 100644
--- a/Documentation/translations/zh_CN/filesystems/sysfs.txt
+++ b/Documentation/translations/zh_CN/filesystems/sysfs.txt
@@ -167,8 +167,8 @@ static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
167 if (dev_attr->show) 167 if (dev_attr->show)
168 ret = dev_attr->show(dev, dev_attr, buf); 168 ret = dev_attr->show(dev, dev_attr, buf);
169 if (ret >= (ssize_t)PAGE_SIZE) { 169 if (ret >= (ssize_t)PAGE_SIZE) {
170 print_symbol("dev_attr_show: %s returned bad count\n", 170 printk("dev_attr_show: %pS returned bad count\n",
171 (unsigned long)dev_attr->show); 171 dev_attr->show);
172 } 172 }
173 return ret; 173 return ret;
174} 174}
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 708f337d780b..c733941901b3 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -46,9 +46,6 @@ extern int sprint_symbol(char *buffer, unsigned long address);
46extern int sprint_symbol_no_offset(char *buffer, unsigned long address); 46extern int sprint_symbol_no_offset(char *buffer, unsigned long address);
47extern int sprint_backtrace(char *buffer, unsigned long address); 47extern int sprint_backtrace(char *buffer, unsigned long address);
48 48
49/* Look up a kernel symbol and print it to the kernel messages. */
50extern void __print_symbol(const char *fmt, unsigned long address);
51
52int lookup_symbol_name(unsigned long addr, char *symname); 49int lookup_symbol_name(unsigned long addr, char *symname);
53int lookup_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name); 50int lookup_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name);
54 51
@@ -118,23 +115,8 @@ static inline int kallsyms_show_value(void)
118 return false; 115 return false;
119} 116}
120 117
121/* Stupid that this does nothing, but I didn't create this mess. */
122#define __print_symbol(fmt, addr)
123#endif /*CONFIG_KALLSYMS*/ 118#endif /*CONFIG_KALLSYMS*/
124 119
125/* This macro allows us to keep printk typechecking */
126static __printf(1, 2)
127void __check_printsym_format(const char *fmt, ...)
128{
129}
130
131static inline void print_symbol(const char *fmt, unsigned long addr)
132{
133 __check_printsym_format(fmt, "");
134 __print_symbol(fmt, (unsigned long)
135 __builtin_extract_return_addr((void *)addr));
136}
137
138static inline void print_ip_sym(unsigned long ip) 120static inline void print_ip_sym(unsigned long ip)
139{ 121{
140 printk("[<%p>] %pS\n", (void *) ip, (void *) ip); 122 printk("[<%p>] %pS\n", (void *) ip, (void *) ip);
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index 531ffa984bc2..32ba256f0092 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -464,17 +464,6 @@ int sprint_backtrace(char *buffer, unsigned long address)
464 return __sprint_symbol(buffer, address, -1, 1); 464 return __sprint_symbol(buffer, address, -1, 1);
465} 465}
466 466
467/* Look up a kernel symbol and print it to the kernel messages. */
468void __print_symbol(const char *fmt, unsigned long address)
469{
470 char buffer[KSYM_SYMBOL_LEN];
471
472 sprint_symbol(buffer, address);
473
474 printk(fmt, buffer);
475}
476EXPORT_SYMBOL(__print_symbol);
477
478/* To avoid using get_symbol_offset for every symbol, we carry prefix along. */ 467/* To avoid using get_symbol_offset for every symbol, we carry prefix along. */
479struct kallsym_iter { 468struct kallsym_iter {
480 loff_t pos; 469 loff_t pos;