From patchwork Mon Dec 11 12:50:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Senozhatsky X-Patchwork-Id: 10104971 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 816FE602B3 for ; Mon, 11 Dec 2017 12:53:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5732929587 for ; Mon, 11 Dec 2017 12:53:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B9C829589; Mon, 11 Dec 2017 12:53:39 +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 D0A4529587 for ; Mon, 11 Dec 2017 12:53:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753224AbdLKMxM (ORCPT ); Mon, 11 Dec 2017 07:53:12 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:46362 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753015AbdLKMxH (ORCPT ); Mon, 11 Dec 2017 07:53:07 -0500 Received: by mail-pf0-f193.google.com with SMTP id c204so11459103pfc.13; Mon, 11 Dec 2017 04:53:07 -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=4gpCZ1HgjbQGL1JUxzN3eohvcZbn2hh+V3Tw9r9L/t0=; b=RKFHbOhnhewTSuijTf/z5y77qWuXPzk/4kyP+gfh6HNJ2cNwYDPq9Sxp1GPSWFTr1u qwij+71CjQQnp+SJmjYvcE2zVqPLuualB99633o101liH1hgpJacwU1a+9F6Xi77W+d5 fA2DpqSF2dnt7a4po9ShbbjJmezXrWqWBmFuCM9vo7RPl96+qp9WoHiCW2YEPEgiH7F5 yVG3i/fAKBNaXwvT6P2Tk7nNH414mwWDQQPebWEq9u4CmuU6lsPf29uOtwCfHNdHAHw5 VSn7BCk4rwZNiNXIioV2A/N28B57Q21ywJh09qKAHUN5M69OictXOkRoLBmt5PtbGxtC ft3w== 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=4gpCZ1HgjbQGL1JUxzN3eohvcZbn2hh+V3Tw9r9L/t0=; b=IPJX8acxTIox5ZAwkic506tM0a5M7l70M5/5rnaW6vrkxDJ35bhd/gWErNgt0madA8 BVCuQaOmvD0CNCtZbo2vwL+rsJnCp4gsNOumM1LYNzKt9KHfBBfmm/0c7WHsBoEslPzf taahpF3Bzo2yivrVhC5ZIkErwOwmArTh108eJ3nsukiOVVkzGs3LBYb2E4GPyyoSF4zY zfRgoEBjoBPlH21LDaHIVE/W4JLePR0zPHGKX5I8QkgIDvK7/m8HovzjMZjotBtmIPBK s8venhPGXFad5w/S8ybGI8msZldZWLKI6+y3zXiKvmtUObYllUjXafY/0Eb3vtxODjp/ fYtQ== X-Gm-Message-State: AKGB3mJGVG25hgSvRpF84T22Toxz/YfxQ5QOipCmD1Akm6qYDaFClupO zyVqRQQXrm0apmxpW7QzD0M= X-Google-Smtp-Source: ACJfBosCntnJdexbrsG0dqprGjd0LF50UeeNR8t6b6jYp4hBAl0TFuo9dn9qHw2RiqFvWLJ/eyh/lA== X-Received: by 10.99.168.5 with SMTP id o5mr232248pgf.427.1512996786885; Mon, 11 Dec 2017 04:53:06 -0800 (PST) Received: from localhost.localdomain ([110.70.53.61]) by smtp.gmail.com with ESMTPSA id j13sm23374380pff.131.2017.12.11.04.52.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Dec 2017 04:53:05 -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 12/13] lib: do not use print_symbol() Date: Mon, 11 Dec 2017 21:50:24 +0900 Message-Id: <20171211125025.2270-13-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: Andrew Morton Cc: Thomas Gleixner --- lib/smp_processor_id.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/smp_processor_id.c b/lib/smp_processor_id.c index 835cc6df2776..85925aaa4fff 100644 --- a/lib/smp_processor_id.c +++ b/lib/smp_processor_id.c @@ -5,7 +5,6 @@ * DEBUG_PREEMPT variant of smp_processor_id(). */ #include -#include #include notrace static unsigned int check_preemption_disabled(const char *what1, @@ -43,7 +42,7 @@ notrace static unsigned int check_preemption_disabled(const char *what1, printk(KERN_ERR "BUG: using %s%s() in preemptible [%08x] code: %s/%d\n", what1, what2, preempt_count() - 1, current->comm, current->pid); - print_symbol("caller is %s\n", (long)__builtin_return_address(0)); + printk("caller is %pS\n", __builtin_return_address(0)); dump_stack(); out_enable: