From patchwork Mon Dec 11 12:50:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Senozhatsky X-Patchwork-Id: 10104951 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 C7DEA602B3 for ; Mon, 11 Dec 2017 12:52:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B1D629586 for ; Mon, 11 Dec 2017 12:52:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F73529588; Mon, 11 Dec 2017 12:52: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 F376529586 for ; Mon, 11 Dec 2017 12:52:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753195AbdLKMwg (ORCPT ); Mon, 11 Dec 2017 07:52:36 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:35160 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752806AbdLKMwb (ORCPT ); Mon, 11 Dec 2017 07:52:31 -0500 Received: by mail-pg0-f68.google.com with SMTP id q20so10860823pgv.2; Mon, 11 Dec 2017 04:52:31 -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=S4BBQHxRzTI99Ok7t1usBu9CO4rOWRUAfLyoo44tKFI=; b=WkaUZzny2ozJ8bD3fuWrHUtYDqb0CmcEb8WacjGz7TNmQ0M39fbUTaWQSZtpD2xzLg CKbBBoTuTL6FMbIkHrbX8VABZKNNNrifERX8yncSS5af1Il2U7EU5QT7ZsiTfVxqcSst pjp+cU+x5bzYkpEM1m73V1WAXJyd2P6Vcwm6nLFvvy+JEuQtlG/XqAEi6ukfPMCNxoXk hw93EaxPsYay1Yddk4lU4NYPIEq9ZuHJ1+bEobmolaXoj53BYYb16yQXnLjkJbToKyBo uBVKgyg/05toTXS1kn8P6P1JZ1BIWWHn2afPHaZPmA2gOiE1InfyYVK0OevcppSoWRSQ dSMA== 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=S4BBQHxRzTI99Ok7t1usBu9CO4rOWRUAfLyoo44tKFI=; b=B3izFJPUa0APXyVurEa8/xdx+wRKpo8vCdMQ8S9gePcFhDcgqk6DTh9N3sP3Fn0sqq UixANksrsco+Gkr5OU0tpqss2KMqTb9iYrIqqfaEyo/NTh3piaDQGfTvAxbGp0OA7PBW 4MzhBo86T8TegYEUMjRgCQkwaoYsVT5PyUCZ6vTTnoC9Lc3t38IImbTO+Iz4ZPmFY9bD j0If9IwTjB/Xgh17cL1gEqO09NoyHICLg1jA53cZ1hKX+MD25D4OPR+aa2YhEaPkvr0B ppQ2MGpDwv5g2NbTNtbMpID37mml/1u6TPANBXpFu20XMmu90hjyWYdYErxvL4Gl8zhT NI8w== X-Gm-Message-State: AKGB3mKkQHEtNf8FWEQA4BHQYz3NTM/zfdylhbegWqLZkEvx2CEdBnph BONIlT7kHgLgsWeSUEf0eMY= X-Google-Smtp-Source: ACJfBosP+OzqDk4xnorBMaOhwtecHBCU2nXmdcFrSkKkr3khKFmNq7Z2i69b8iv1LiU8zDjaKr14LQ== X-Received: by 10.84.168.37 with SMTP id e34mr309979plb.10.1512996750771; Mon, 11 Dec 2017 04:52:30 -0800 (PST) Received: from localhost.localdomain ([110.70.53.61]) by smtp.gmail.com with ESMTPSA id j13sm23374380pff.131.2017.12.11.04.52.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Dec 2017 04:52:29 -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 09/13] drivers: do not use print_symbol() Date: Mon, 11 Dec 2017 21:50:21 +0900 Message-Id: <20171211125025.2270-10-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 --- drivers/base/core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index bf45587bcb46..36e20498159b 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -685,8 +684,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; }