From patchwork Thu Dec 21 05:54:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Senozhatsky X-Patchwork-Id: 10126941 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 46CD06019C for ; Thu, 21 Dec 2017 05:54:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B16429A7D for ; Thu, 21 Dec 2017 05:54:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1DD6429A81; Thu, 21 Dec 2017 05:54:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 593EC29A7D for ; Thu, 21 Dec 2017 05:54:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750871AbdLUFye (ORCPT ); Thu, 21 Dec 2017 00:54:34 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:33185 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750757AbdLUFyc (ORCPT ); Thu, 21 Dec 2017 00:54:32 -0500 Received: by mail-pg0-f65.google.com with SMTP id g7so12897871pgs.0; Wed, 20 Dec 2017 21:54:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=sLm10bzq1dVcRK38zSGQzpI2jPvcKVB0951S1MI9dNI=; b=QOeU94uIwU6HuAaOvfJe0GztL7f+MYhvSIQRmPRwjefaqlyeSEDnDQ5o3LVZ8h6PC8 Rdzv1ZlRoHlsL68edDm1/iCcWeEbkuChZC2oG+EbY8n/0fIWlS24OwRYXYPUbEYuZQSS mKIELqMeJr50akG4yb2kUzFEltw32JZmPn1rDVQK8X+T/Jkjtzcgki+3dYtN07LPfnMk nYrXS6iJDRhaLteJ+ELKUs9jrdr/YQpULiCpSV8O62pJy9Ow9c12kfsPt3YzBbWpsoEu seaXAqi/p2pgad9oZtAL7wsLJAbeG6IqZif7F1LSHtr0tqo1F8gNDpK82Qu+sQ4s+iWV wZEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=sLm10bzq1dVcRK38zSGQzpI2jPvcKVB0951S1MI9dNI=; b=NkH5fw/q3+PcZPw3RXsEXULVytiNcdniq6nWrnJyOXsrJp2s7P/Q1k2x1YEoLIv0xU Pzwi/Bi4cMIlk8vIYMSFGEUkYi02hwAxzyxZ3spRIvOwcyXy0Wj0DRIjKyfKZZniuiJO 0GRF2SpispyUVj1NRRPyPdWlITYAQUq4eO/wzS2hKwqpJIBDJQz2aIq5BQ34x2NdtNWn HNr+JwSZzK04qCqEVz5fZhqtZgcfn7RTKF93gWLPKHTCGbmhJ/24H7paBonWSdWD4YTl b/jvczO+23sikbeMG7SOVmxlRPidaoGLD8AbI+RadsudHInhcnBPF/zgTQKLWf8AKSUO fYZA== X-Gm-Message-State: AKGB3mI1LWUiMA3yhYeWr6PAfx1lw/YXfYwb9/2WSjvtYjsKtsYh6KgH dz2HYYhpA055Xdk7TSK4bVU= X-Google-Smtp-Source: ACJfBovblU0WZdbNZPx6tj5M/w0tZbzb8HyMggufXZ7q+2GiG594a06PvAVLE8kjy4DDTwio1wcxag== X-Received: by 10.101.83.196 with SMTP id z4mr1567643pgr.124.1513835671689; Wed, 20 Dec 2017 21:54:31 -0800 (PST) Received: from localhost ([175.223.27.214]) by smtp.gmail.com with ESMTPSA id h81sm40621228pfh.119.2017.12.20.21.54.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Dec 2017 21:54:30 -0800 (PST) Date: Thu, 21 Dec 2017 14:54:27 +0900 From: Sergey Senozhatsky To: Joe Perches Cc: Sergey Senozhatsky , Andrew Morton , Russell King , Catalin Marinas , Mark Salter , Tony Luck , David Howells , Yoshinori Sato , Guan Xuetao , Borislav Petkov , Greg Kroah-Hartman , Thomas Gleixner , Peter Zijlstra , Vineet Gupta , Fengguang Wu , Steven Rostedt , Petr Mladek , LKML , linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-ia64@vger.kernel.org, linux-am33-list@redhat.com, linux-sh@vger.kernel.org, linux-edac@vger.kernel.org, x86@kernel.org, linux-snps-arc@lists.infradead.org, Sergey Senozhatsky Subject: Re: [PATCH 00/13] replace print_symbol() with printk()-s Message-ID: <20171221055427.GA385@jagdpanzerIV> References: <20171211125025.2270-1-sergey.senozhatsky@gmail.com> <1513009569.26342.43.camel@perches.com> <20171212024757.GC7798@jagdpanzerIV> <1513048252.3036.23.camel@perches.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1513048252.3036.23.camel@perches.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On (12/11/17 19:10), Joe Perches wrote: [..] > As far as I'm concerned, as soon as there is > no longer a single user in the kernel tree, > better to delete it instead. sounds good to me. can drop it, once the series upstreamed. 8< --- From: Sergey Senozhatsky Subject: [PATCH] kallsyms: remove print_symbol() function No more print_symbol()/__print_symbol() users left, remove these symbols. Signed-off-by: Sergey Senozhatsky Suggested-by: Joe Perches --- Documentation/filesystems/sysfs.txt | 4 ++-- Documentation/translations/zh_CN/filesystems/sysfs.txt | 4 ++-- include/linux/kallsyms.h | 18 ------------------ 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, if (dev_attr->show) ret = dev_attr->show(dev, dev_attr, buf); if (ret >= (ssize_t)PAGE_SIZE) { - print_symbol("dev_attr_show: %s returned bad count\n", - (unsigned long)dev_attr->show); + printk("dev_attr_show: %pS returned bad count\n", + dev_attr->show); } return ret; } 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, if (dev_attr->show) ret = dev_attr->show(dev, dev_attr, buf); if (ret >= (ssize_t)PAGE_SIZE) { - print_symbol("dev_attr_show: %s returned bad count\n", - (unsigned long)dev_attr->show); + printk("dev_attr_show: %pS returned bad count\n", + dev_attr->show); } return ret; } diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index 7288f9c395b6..d79d1e7486bd 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h @@ -94,9 +94,6 @@ extern int sprint_symbol(char *buffer, unsigned long address); extern int sprint_symbol_no_offset(char *buffer, unsigned long address); extern int sprint_backtrace(char *buffer, unsigned long address); -/* Look up a kernel symbol and print it to the kernel messages. */ -extern void __print_symbol(const char *fmt, unsigned long address); - int lookup_symbol_name(unsigned long addr, char *symname); int lookup_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name); @@ -166,23 +163,8 @@ static inline int kallsyms_show_value(void) return false; } -/* Stupid that this does nothing, but I didn't create this mess. */ -#define __print_symbol(fmt, addr) #endif /*CONFIG_KALLSYMS*/ -/* This macro allows us to keep printk typechecking */ -static __printf(1, 2) -void __check_printsym_format(const char *fmt, ...) -{ -} - -static inline void print_symbol(const char *fmt, unsigned long addr) -{ - __check_printsym_format(fmt, ""); - __print_symbol(fmt, (unsigned long) - __builtin_extract_return_addr((void *)addr)); -} - static inline void print_ip_sym(unsigned long ip) { printk("[<%p>] %pS\n", (void *) ip, (void *) ip); diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c index 24f456689f9c..a23e21ada81b 100644 --- a/kernel/kallsyms.c +++ b/kernel/kallsyms.c @@ -429,17 +429,6 @@ int sprint_backtrace(char *buffer, unsigned long address) return __sprint_symbol(buffer, address, -1, 1); } -/* Look up a kernel symbol and print it to the kernel messages. */ -void __print_symbol(const char *fmt, unsigned long address) -{ - char buffer[KSYM_SYMBOL_LEN]; - - sprint_symbol(buffer, address); - - printk(fmt, buffer); -} -EXPORT_SYMBOL(__print_symbol); - /* To avoid using get_symbol_offset for every symbol, we carry prefix along. */ struct kallsym_iter { loff_t pos;