From patchwork Fri May 5 19:47:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 98684 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp292769qge; Fri, 5 May 2017 12:48:31 -0700 (PDT) X-Received: by 10.99.126.92 with SMTP id o28mr5453661pgn.63.1494013711768; Fri, 05 May 2017 12:48:31 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 144si6012850pfa.118.2017.05.05.12.48.31; Fri, 05 May 2017 12:48:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755571AbdEETsa (ORCPT + 6 others); Fri, 5 May 2017 15:48:30 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:62658 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754515AbdEETs2 (ORCPT ); Fri, 5 May 2017 15:48:28 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.129]) with ESMTPA (Nemesis) id 0MDHpc-1dGeJm3L00-00Gbsf; Fri, 05 May 2017 21:48:22 +0200 From: Arnd Bergmann To: Ben Hutchings Cc: stable@vger.kernel.org, Arnd Bergmann , "David S . Miller" Subject: [PATCH 3.16-stable 47/87] mISDN: avoid arch specific __builtin_return_address call Date: Fri, 5 May 2017 21:47:05 +0200 Message-Id: <20170505194745.3627137-48-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170505194745.3627137-1-arnd@arndb.de> References: <20170505194745.3627137-1-arnd@arndb.de> X-Provags-ID: V03:K0:/szpWEsBna273ap2AitJicos2T9b+Y5GogeZyjxKYUiQIIcHuS0 PtF07bOrAIXh4m5m2mW+KXQMfVM+Ji191ej7NIgQbbA9PZ32x1WZFZqi1zlabUIgy2MnlXM YwGzNM5w5f8BwX57D1FDvNjYh2lg940n0cBAEO/SKvBWgM5mMIUrDVuymMM1EwFTA/pYBzb ADkezsw2P6LIhlEu3S6wg== X-UI-Out-Filterresults: notjunk:1; V01:K0:aTGxLatF0a0=:U7YF4pE2YYU4IMAdvAoaqy YBuLIBJbw6fnOl8dOe17u8tw43Hxb+k30+Y3nttd7xI1RypPOZcXJoq4lE5We0wFD6I2i74GE H7VU6K5ltplQ7a6p8ubiCW2bTpdLT04n9QBFcQ/dHoPIJnLlac4RY7dSB9jsPLk0p/Z0vfNO3 qfeBOoCXSD9pyv7BkSp9hST4p21E1vcT9b/FxW/P//HV64f8/xu6SOjcK3AA73Qfq1UWxKc3l D4bqNzS4lFPiqh96X9FSn3xziqmTUdS/3upvsSOqCR8SLwFkwPryhbJJwrWkiz+6pIHSRsqBe 5vybMJpnjVyr+ITkNOL38sfaRmS95o064Qoz/nSqUIgQnc7HeFzKJr7Xxblpwxh3EUiE9Vo0t e/wnv6NU5JtWgVb/MDYvSw3hDOlS6cmLnO1QGhuJQM7q9iKWh2RB3ZcikNhYTpOhnOX7c5SeN Nl5mbgOi6WLgTm9LIF+RwTDltoYIzBjPgsKwN2D1ZVV0NUQN4tYQc8dW6xwygMw9XZiE9riiY KKCdqSvNsd1AstJUMT8XeqOQ4dCb41cONZDfV98nknBDoMNLp0/rM3Is1yn4tOLCdHAsf9o7u kQScPOJaiR4UMm2KRInx70GmkB7R8/UuhCKMeehLAPUMP0DbrxyWFsLPnevQC51emHk4K9Y/k 1fMSCA4985hb/E1nzpdWivgZCUnC75lG1sOFzQ5/BXxMJhT5cxf8+Zzs/5RgSRtBpxxo= Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Commit 3e7a8716e20b759eec0ad88145255bb33174f0c8 upstream. Not all architectures are able to call __builtin_return_address(). On ARM, the mISDN code produces this warning: hardware/mISDN/w6692.c: In function 'w6692_dctrl': hardware/mISDN/w6692.c:1181:75: warning: unsupported argument to '__builtin_return_address' pr_debug("%s: %s dev(%d) open from %p\n", card->name, __func__, ^ hardware/mISDN/mISDNipac.c: In function 'open_dchannel': hardware/mISDN/mISDNipac.c:759:75: warning: unsupported argument to '__builtin_return_address' pr_debug("%s: %s dev(%d) open from %p\n", isac->name, __func__, ^ In a lot of cases, this is relatively easy to work around by passing the value of __builtin_return_address(0) from the callers into the functions that want it. One exception is the indirect 'open' function call in struct isac_hw. While it would be possible to fix this as well, this patch only addresses the other callers properly and lets this one return the direct parent function, which should be good enough. Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller Signed-off-by: Arnd Bergmann --- drivers/isdn/hardware/mISDN/mISDNipac.c | 12 +++++++++--- drivers/isdn/hardware/mISDN/w6692.c | 6 +++--- 2 files changed, 12 insertions(+), 6 deletions(-) -- 2.9.0 diff --git a/drivers/isdn/hardware/mISDN/mISDNipac.c b/drivers/isdn/hardware/mISDN/mISDNipac.c index 92cf6fcd20ac..cb428b9ee441 100644 --- a/drivers/isdn/hardware/mISDN/mISDNipac.c +++ b/drivers/isdn/hardware/mISDN/mISDNipac.c @@ -754,10 +754,10 @@ dbusy_timer_handler(struct isac_hw *isac) } static int -open_dchannel(struct isac_hw *isac, struct channel_req *rq) +open_dchannel_caller(struct isac_hw *isac, struct channel_req *rq, void *caller) { pr_debug("%s: %s dev(%d) open from %p\n", isac->name, __func__, - isac->dch.dev.id, __builtin_return_address(1)); + isac->dch.dev.id, caller); if (rq->protocol != ISDN_P_TE_S0) return -EINVAL; if (rq->adr.channel == 1) @@ -771,6 +771,12 @@ open_dchannel(struct isac_hw *isac, struct channel_req *rq) return 0; } +static int +open_dchannel(struct isac_hw *isac, struct channel_req *rq) +{ + return open_dchannel_caller(isac, rq, __builtin_return_address(0)); +} + static const char *ISACVer[] = {"2086/2186 V1.1", "2085 B1", "2085 B2", "2085 V2.3"}; @@ -1547,7 +1553,7 @@ ipac_dctrl(struct mISDNchannel *ch, u32 cmd, void *arg) case OPEN_CHANNEL: rq = arg; if (rq->protocol == ISDN_P_TE_S0) - err = open_dchannel(isac, rq); + err = open_dchannel_caller(isac, rq, __builtin_return_address(0)); else err = open_bchannel(ipac, rq); if (err) diff --git a/drivers/isdn/hardware/mISDN/w6692.c b/drivers/isdn/hardware/mISDN/w6692.c index de69f6828c76..741675525b53 100644 --- a/drivers/isdn/hardware/mISDN/w6692.c +++ b/drivers/isdn/hardware/mISDN/w6692.c @@ -1176,10 +1176,10 @@ w6692_l1callback(struct dchannel *dch, u32 cmd) } static int -open_dchannel(struct w6692_hw *card, struct channel_req *rq) +open_dchannel(struct w6692_hw *card, struct channel_req *rq, void *caller) { pr_debug("%s: %s dev(%d) open from %p\n", card->name, __func__, - card->dch.dev.id, __builtin_return_address(1)); + card->dch.dev.id, caller); if (rq->protocol != ISDN_P_TE_S0) return -EINVAL; if (rq->adr.channel == 1) @@ -1207,7 +1207,7 @@ w6692_dctrl(struct mISDNchannel *ch, u32 cmd, void *arg) case OPEN_CHANNEL: rq = arg; if (rq->protocol == ISDN_P_TE_S0) - err = open_dchannel(card, rq); + err = open_dchannel(card, rq, __builtin_return_address(0)); else err = open_bchannel(card, rq); if (err)