From patchwork Fri Jan 5 10:25:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Senozhatsky X-Patchwork-Id: 10146251 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 3CD53601A1 for ; Fri, 5 Jan 2018 10:26:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A8C82887E for ; Fri, 5 Jan 2018 10:26:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D9AE28883; Fri, 5 Jan 2018 10:26:05 +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=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 970A52887E for ; Fri, 5 Jan 2018 10:26:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=c2t8FmzMeKkmhndNjwYq59ULVfQFw5ljjdrOEU+jeKc=; b=i32CSlqh5TcQgu 5JvR4qXz8WQgMjTNvpXUJI+dXYZwdHPByvwPZEEcF7kVlTAMQEsUl6byMUg43X2JJnB8PC+fCv93C 06swOKPxsLOO1N7b18EjHBA22rlSKN0GEqnyHXZWkxvm/ewwgXBRRUpZI4dWT7eHjTqX6A9En1RNF jjME9BYWaNafJHZ5OdDSUIlZdnm4RjWRSiCZvE5zHtKuoSDaCQ8sqnwPPcNsuOAlqM6L9xqThT1HN hScJz5SZecE06ED0thGHxz7aox4SwmusHfGsQftHHZlYRBZuo99CTDCfLoPoGDkAciQqbiUmU0OHI DYQBZxX0jQ3R0eka9Vwg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eXPCJ-0000YP-Oa; Fri, 05 Jan 2018 10:25:59 +0000 Received: from mail-pl0-x242.google.com ([2607:f8b0:400e:c01::242]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eXPCE-0008Vg-6C; Fri, 05 Jan 2018 10:25:56 +0000 Received: by mail-pl0-x242.google.com with SMTP id b12so2831212plm.3; Fri, 05 Jan 2018 02:25:43 -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=Th7GJXn1Gx/7KYK9yWFsmG1jSON7w4+ljUcaiZZQslg=; b=uZ1eIj5gTq6pEGyLvOXyh/gZWIKQksvFXYa7sjFiMlEkezA/QEyCI4KuODru2E4Mxv 9rL60J4lSE0HApKyy9C01MbN5fb/fS2p0CfeUHmR1iNJQVAxxHNuhnHJJTV6BrQsRSAZ FLKh9N2wyW9GBSCB+Q10Hg9ghrpMjeu/Xjq6aECiiY3Ho85fBhbuqcBYsYc8C1T3NpIW iBHaLVdBDbjlzPdXb5Tb7sHwsgzFGdsWYn6J9cCYyhEzFhXAF807OuLchQP1RuNxoBNN o5GJBpMrsl4SwSaU4H2ssQ0zA23Ujqg1rN29gJp+MIvl8ZV1htuu/nEMVvD3j7Rr/dcW O57A== 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=Th7GJXn1Gx/7KYK9yWFsmG1jSON7w4+ljUcaiZZQslg=; b=lkZupCt3xzmBrZReVPPs2pmZ+/bTK8UWAPU8pANttPdUcSO2kbUAEWpkIb9PzKVlyQ gSkcUymBmPs4juUaUwTPGaC3otiJRH8Dn2721Asinep4L9lQImqaLpFAMOQYYHD9EjhI hZxer8xQ0ovcq3NbOuAVfgpG6ME/EPas2Ev2WuqMVjLg0jDyy9ivJkNh+A3f0kmeSavY bavbOJoTjgEI9NtaDpGPM7zRfEARX9G1knlhknxsV5MptJd7g0IEQ3DyQlWmkShXAvLT +lF44+aIRxReJCJBMY9ZDC5bb+fTSRFEP8OPmqwGOJ7Sv4kTc0akl1xLKJd6X+kUt40C iDwg== X-Gm-Message-State: AKGB3mK4hYitOIEPjOggf3x0ra4Bba5bpqltKYXPIBfK/LjRl5fKIS4Q HhGFm9Wd7Gi7LrXZwdaaAeM= X-Google-Smtp-Source: ACJfBovCYZdAfuMjZ9n+i9etn+9qEUk7Pak6lgDcFZD5+5j1bfo+CcgLkJKHIyi/hS2Eq1hfMNHkzA== X-Received: by 10.159.245.138 with SMTP id a10mr2639190pls.178.1515147943286; Fri, 05 Jan 2018 02:25:43 -0800 (PST) Received: from localhost ([175.223.14.195]) by smtp.gmail.com with ESMTPSA id n22sm9869210pgd.86.2018.01.05.02.25.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Jan 2018 02:25:41 -0800 (PST) Date: Fri, 5 Jan 2018 19:25:38 +0900 From: Sergey Senozhatsky To: Sergey Senozhatsky Subject: Re: [PATCH 00/13] replace print_symbol() with printk()-s Message-ID: <20180105102538.GC471@jagdpanzerIV> References: <20171211125025.2270-1-sergey.senozhatsky@gmail.com> <20180105100300.j3svmcvvpfe2iows@pathway.suse.cz> <20180105102105.GB471@jagdpanzerIV> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180105102105.GB471@jagdpanzerIV> User-Agent: Mutt/1.9.2 (2017-12-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180105_022554_349975_ADBE7661 X-CRM114-Status: GOOD ( 19.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, Peter Zijlstra , Catalin Marinas , David Howells , Guan Xuetao , linux-am33-list@redhat.com, linux-c6x-dev@linux-c6x.org, Yoshinori Sato , x86@kernel.org, Russell King , Mark Salter , linux-snps-arc@lists.infradead.org, Petr Mladek , Steven Rostedt , Borislav Petkov , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, linux-edac@vger.kernel.org, Tony Luck , Greg Kroah-Hartman , LKML , Sergey Senozhatsky , Vineet Gupta , Andrew Morton , Fengguang Wu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On (01/05/18 19:21), Sergey Senozhatsky wrote: > On (01/05/18 11:03), Petr Mladek wrote: > [..] > > Anyway, print_symbol() is an old weird API and it would be nice > > to eventually get rid of it. I could take this patches into > > printk.git. > > no objections from my side if the patch set will go through the printk tree. > shall we wait for ACKs or can we move on? do you plan to land it in 4.16? > > > Would you mind if I change the commit messages to something like?: > > > > print_symbol() is an old weird API. It has been > > obsoleted by printk() and %pS format specifier. > > I wouldn't. let's drop the "weird" part. other than that looks > good to me. oh, one more thing. one extra patch, which gets rid of print_symbol()/__print_symbol(). 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 23190e5c940b..657a83b943f0 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("[<%px>] %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;