From patchwork Mon Dec 11 12:50:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Senozhatsky X-Patchwork-Id: 10104973 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 7A52A602B3 for ; Mon, 11 Dec 2017 12:53:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F6B029587 for ; Mon, 11 Dec 2017 12:53:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4407C29589; Mon, 11 Dec 2017 12:53:43 +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 E1B1C29587 for ; Mon, 11 Dec 2017 12:53:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752951AbdLKMwr (ORCPT ); Mon, 11 Dec 2017 07:52:47 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:35177 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752842AbdLKMwm (ORCPT ); Mon, 11 Dec 2017 07:52:42 -0500 Received: by mail-pg0-f68.google.com with SMTP id q20so10861151pgv.2; Mon, 11 Dec 2017 04:52:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JWgoK9afefGQjnRiHihdqCp0j3QrBwlFdVYG+CbmKZY=; b=GIG/N8ts9L0JRqJHZLAsVD6KCrT1qrSgF9bN+DW6dSjBud03dUsYugBCRQ8p8WiZiM accsuUP2vtVEiBpX7wqTOs8MEdEPyo2lSc39mLhNfp8nvcOaE1R4wwXoi98hei1qA6vm 3O4cMizp6LxGE/Tm5ncE3xP9UkVvpWzDJ9hhNqr3iy56b9gQOCm3WnqlgUrjgZKNqZMI apfiyfSDB3Hi4kUV3kZWRx1noX0MsKohzIzdLlYPzLagMYvpBpEtBhHqjbFsD06KaOv6 7EoqRYA1QaKGC3hb8EKqeNat6sgT/6jm99kjvHmV36dbADH45WHzDXOGFVKfrHlGuC2M hbGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JWgoK9afefGQjnRiHihdqCp0j3QrBwlFdVYG+CbmKZY=; b=len7v8HnoNAlnyrsKsOpIPtXYpGdy6XFjGtFpMBlGXb1ZG2GTYMicEOAymZeq/XF39 nk9xViMdBU9bV5nLQXmy5NW4c6/aii6UZzK9WsXMukfSc5iwgw1MXDZp8pBH3HoIva/g mQYY8h4NzdbOTG0+Z2YsB7+PPI4OPomE2jsnyhmQmntpZPYH2daXhbTJ+xCI1n6lSmjI Y7vZgO1CPRkir2Lrgf1QwDeLIlqIYMdFVLUB8TzNKBnfeP655N9U2ItqlzVKH73I0R6b EBwo7tTyjY4RuasEh+yjIEOd8ytuMfLC2mrhG7G04hySuRyBUVL5m6442YjhbmhKOJEt sDcw== X-Gm-Message-State: AKGB3mKHUg/xAbZYyyqf5crb9faIGhjRrkEqLVwe+QOYbZRIHnNAv7Xl nhfjQyNBxwr2Ct3ekrOeJJ8= X-Google-Smtp-Source: ACJfBouo/AKXGADejX+CQGgn30nxuDayH5f8aTBQKht1GNq5+PRD2iawkwWKDObGrDz9z4UppmAxGQ== X-Received: by 10.98.66.77 with SMTP id p74mr260909pfa.183.1512996762317; Mon, 11 Dec 2017 04:52:42 -0800 (PST) Received: from localhost.localdomain ([110.70.53.61]) by smtp.gmail.com with ESMTPSA id j13sm23374380pff.131.2017.12.11.04.52.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Dec 2017 04:52:41 -0800 (PST) From: Sergey Senozhatsky X-Google-Original-From: Sergey Senozhatsky To: 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 Cc: 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 , Sergey Senozhatsky Subject: [PATCH 10/13] sysfs: do not use print_symbol() Date: Mon, 11 Dec 2017 21:50:22 +0900 Message-Id: <20171211125025.2270-11-sergey.senozhatsky@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171211125025.2270-1-sergey.senozhatsky@gmail.com> References: <20171211125025.2270-1-sergey.senozhatsky@gmail.com> 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 print_symbol() uses extra stack space to sprintf() symbol information and then to feed that buffer to printk() char buffer[KSYM_SYMBOL_LEN]; sprint_symbol(buffer, address); printk(fmt, buffer); Replace print_symbol() with a direct printk("%pS") call. Signed-off-by: Sergey Senozhatsky Cc: Greg Kroah-Hartman --- fs/sysfs/file.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index 39c75a86c67f..bfcbe486d385 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c @@ -12,7 +12,6 @@ #include #include -#include #include #include #include @@ -70,8 +69,8 @@ static int sysfs_kf_seq_show(struct seq_file *sf, void *v) * indicate truncated result or overflow in normal use cases. */ if (count >= (ssize_t)PAGE_SIZE) { - print_symbol("fill_read_buffer: %s returned bad count\n", - (unsigned long)ops->show); + printk("fill_read_buffer: %pS returned bad count\n", + ops->show); /* Try to struggle along */ count = PAGE_SIZE - 1; }