diff options
author | Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> | 2018-01-05 05:25:38 -0500 |
---|---|---|
committer | Petr Mladek <pmladek@suse.com> | 2018-01-16 10:59:55 -0500 |
commit | d2279c9d7f7db7f97567368bfc4539b3411adf8d (patch) | |
tree | 432344b066dc86f2e4a5a303f7a7bf067561bebc | |
parent | d202d47b5e62cbd54d2cfffbe01471a7690dc652 (diff) |
kallsyms: remove print_symbol() function
No more print_symbol()/__print_symbol() users left, remove these
symbols.
It was a very old API that encouraged people use continuous lines.
It had been obsoleted by %pS format specifier in a normal printk()
call.
Link: http://lkml.kernel.org/r/20180105102538.GC471@jagdpanzerIV
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Mark Salter <msalter@redhat.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-c6x-dev@linux-c6x.org
Cc: linux-ia64@vger.kernel.org
Cc: linux-am33-list@redhat.com
Cc: linux-sh@vger.kernel.org
Cc: linux-edac@vger.kernel.org
Cc: x86@kernel.org
Cc: linux-snps-arc@lists.infradead.org
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Suggested-by: Joe Perches <joe@perches.com>
[pmladek@suse.com: updated commit message]
Signed-off-by: Petr Mladek <pmladek@suse.com>
-rw-r--r-- | Documentation/filesystems/sysfs.txt | 4 | ||||
-rw-r--r-- | Documentation/translations/zh_CN/filesystems/sysfs.txt | 4 | ||||
-rw-r--r-- | include/linux/kallsyms.h | 18 | ||||
-rw-r--r-- | kernel/kallsyms.c | 11 |
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); | |||
46 | extern int sprint_symbol_no_offset(char *buffer, unsigned long address); | 46 | extern int sprint_symbol_no_offset(char *buffer, unsigned long address); |
47 | extern int sprint_backtrace(char *buffer, unsigned long address); | 47 | extern int sprint_backtrace(char *buffer, unsigned long address); |
48 | 48 | ||
49 | /* Look up a kernel symbol and print it to the kernel messages. */ | ||
50 | extern void __print_symbol(const char *fmt, unsigned long address); | ||
51 | |||
52 | int lookup_symbol_name(unsigned long addr, char *symname); | 49 | int lookup_symbol_name(unsigned long addr, char *symname); |
53 | int lookup_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name); | 50 | int 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 */ | ||
126 | static __printf(1, 2) | ||
127 | void __check_printsym_format(const char *fmt, ...) | ||
128 | { | ||
129 | } | ||
130 | |||
131 | static 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 | |||
138 | static inline void print_ip_sym(unsigned long ip) | 120 | static 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. */ | ||
468 | void __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 | } | ||
476 | EXPORT_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. */ |
479 | struct kallsym_iter { | 468 | struct kallsym_iter { |
480 | loff_t pos; | 469 | loff_t pos; |