From patchwork Thu Mar 1 15:27:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 130305 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp2953360edc; Thu, 1 Mar 2018 07:39:22 -0800 (PST) X-Google-Smtp-Source: AG47ELtk5wnSVSNxyI77OB59jaVjBzSht4uHXQJfR1/QBk1U+Kf6tx2aC3Dvxx16c8ftlR+XNc0J X-Received: by 10.99.125.79 with SMTP id m15mr1857846pgn.428.1519918762703; Thu, 01 Mar 2018 07:39:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519918762; cv=none; d=google.com; s=arc-20160816; b=jAYpKgUwqb8Mr8SNImuQjc9etghYZMTg7hBUYJsrRoFCz2L0/PTx7z1+Z0uSnHmeUa 0z2n/8c0IF6aCSq/qwOYTiT666owNk6qk+dZZJsoYHaHvSJb4wurZWKBvm7VLfw/u6UZ 7+AU6cGZfLuvC9XytmYgCc1dgmkOigv1nuXwYXWMja/XsBXvXZByJXVozs/lzbCVBhEq ZWlgjSKMFqU4z+1mM9GfSB5p4SlUxJHWTIANJ8IZJUtD45VyLFQ4XoQXwiOAshgnS/lI /a3pnCruh8pPw8rZA+tbo3MGGSvO4F9+JOOcE+mqV2vOCuTGCtS2BYIHlLMEMzI+LY4P GJFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=LpmXrVBoZ8Y2QaeeQuyyFhG9t4zmZ6ndiAeYubBJ1SE=; b=nvNWzN0v6okybJmutMDNwG/ZgoI5KS16Qi0yE4J+a7/3Lkrxiq//3180FJvvnss0vg UoO08yLJpMCpkaasStl1+n9125SkXsa7sPNPlo1bWEA7xv+rPZ1F2K68kWiS5GIixdY6 5qDQ6pB35HW8H8YcRp0H0Xq75XveL1e/dPJVZkerAG+Viae32tYEpPwQ7SX6gx96EQcK 0joqnLapgYuRhkeiyKCrlntIJ4zolThmH2/8OMAFAJJl1S4018+Gz8xt/wsYk5Q4yYGz J/qsOkdTzfrhnguqtJVIS8cMCHgb14Dw3isqUgmErBHXaAB7py9bBcwU1k3m4dtufGGN syMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=iF2U9kKW; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k15si2606322pgc.482.2018.03.01.07.39.22; Thu, 01 Mar 2018 07:39:22 -0800 (PST) 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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=iF2U9kKW; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032484AbeCAPjQ (ORCPT + 10 others); Thu, 1 Mar 2018 10:39:16 -0500 Received: from mail-bn3nam01on0096.outbound.protection.outlook.com ([104.47.33.96]:49984 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032271AbeCAPjN (ORCPT ); Thu, 1 Mar 2018 10:39:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=LpmXrVBoZ8Y2QaeeQuyyFhG9t4zmZ6ndiAeYubBJ1SE=; b=iF2U9kKWluMNWKNjlelNtthX+ByRFjkseoJwyGmzjuIP0eW+NDrdJTugysb41dIp1JPj9LZLfXu0rkuk65OUiwLQHBiHYQXF8TdZSY2+T335k9ionXK+HAFesnca3cErGveixwcPmgbr62T9G/BT8BC31WRLaxWXeLUk0J8v9Cs= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0902.namprd21.prod.outlook.com (52.132.132.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.567.2; Thu, 1 Mar 2018 15:39:11 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446%2]) with mapi id 15.20.0567.006; Thu, 1 Mar 2018 15:39:11 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Arnd Bergmann , "David S . Miller" , Sasha Levin Subject: [added to the 4.1 stable tree] ISDN: eicon: reduce stack size of sig_ind function Thread-Topic: [added to the 4.1 stable tree] ISDN: eicon: reduce stack size of sig_ind function Thread-Index: AQHTsXHTJ75EDnkgZUWmPHG0hXaDgA== Date: Thu, 1 Mar 2018 15:27:36 +0000 Message-ID: <20180301152116.1486-479-alexander.levin@microsoft.com> References: <20180301152116.1486-1-alexander.levin@microsoft.com> In-Reply-To: <20180301152116.1486-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR2101MB0902; 7:jX3B5ri/pmBuMFwSgtW2h98FGmO/JY+VxwQG2i2uFYO2fBkmdh03MULNuaWLDarNO1cjCpLoSzxs8FhSN9eBFukegREDZ0WTzx/EHaDO4KQ9Tow9FuekzoOI2uidKgv9e3mdOGJdb6iIAbqNzMjoZbByGe3tscGvSZl700VZN5fgrhfEdoqn8YoUNrEEPNnCOaYXTd0lHXMnTjIuG4vkY+MpCqU+nNQ5Acsmps7zgqjDVahGIPRkG4Xb6siv5WYw x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: fcc879eb-d475-4a28-a2b0-08d57f8a9430 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7193020); SRVR:DM5PR2101MB0902; x-ms-traffictypediagnostic: DM5PR2101MB0902: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040501)(2401047)(8121501046)(5005006)(3231220)(944501229)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:DM5PR2101MB0902; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB0902; x-forefront-prvs: 05986C03E0 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(366004)(376002)(39380400002)(39860400002)(346002)(199004)(189003)(6116002)(72206003)(1076002)(3846002)(25786009)(2900100001)(36756003)(14454004)(316002)(3660700001)(6666003)(54906003)(110136005)(2950100002)(305945005)(7736002)(99286004)(5250100002)(86612001)(10090500001)(107886003)(66066001)(106356001)(2501003)(6512007)(6486002)(97736004)(6436002)(22452003)(68736007)(81166006)(8676002)(81156014)(53936002)(186003)(26005)(105586002)(3280700002)(8936002)(76176011)(478600001)(4326008)(10290500003)(575784001)(86362001)(5660300001)(2906002)(6506007)(102836004)(59450400001)(6346003)(22906009); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB0902; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: BVOE4f/uy970hwFyFQ24BEcMSGhvXRvQC2sG1JXDkjdQ4Galj4tWbeBZESzgBBu2979WIK9MgRp18Q11NyEe1R7geMZFl72Hy6mZAbKhQm5fJ0tUi2qg4DoHULDkdJ/zALJqN/mLdGTFzM3+//OvMJ69B2/NmPM/qS1t00ljvAs= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: fcc879eb-d475-4a28-a2b0-08d57f8a9430 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Mar 2018 15:27:36.6697 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0902 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. -- 2.14.1 =============== [ Upstream commit 27d807180ae0a9e50d90adf9b22573c21be904c2 ] I noticed that this function uses a lot of kernel stack when the "latent entropy" plugin is enabled: drivers/isdn/hardware/eicon/message.c: In function 'sig_ind': drivers/isdn/hardware/eicon/message.c:6113:1: error: the frame size of 1168 bytes is larger than 1152 bytes [-Werror=frame-larger-than=] We currently don't warn about this, as we raise the warning limit to 2048 bytes in mainline, but I'd like to lower that limit again in the future, and this function can easily be changed to be more efficient and avoid that warning, by making some of its local variables 'const'. Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/isdn/hardware/eicon/message.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/isdn/hardware/eicon/message.c b/drivers/isdn/hardware/eicon/message.c index 7b4ddf0a39ec..2d28530b7e82 100644 --- a/drivers/isdn/hardware/eicon/message.c +++ b/drivers/isdn/hardware/eicon/message.c @@ -147,7 +147,7 @@ static word plci_remove_check(PLCI *); static void listen_check(DIVA_CAPI_ADAPTER *); static byte AddInfo(byte **, byte **, byte *, byte *); static byte getChannel(API_PARSE *); -static void IndParse(PLCI *, word *, byte **, byte); +static void IndParse(PLCI *, const word *, byte **, byte); static byte ie_compare(byte *, byte *); static word find_cip(DIVA_CAPI_ADAPTER *, byte *, byte *); static word CPN_filter_ok(byte *cpn, DIVA_CAPI_ADAPTER *, word); @@ -4860,7 +4860,7 @@ static void sig_ind(PLCI *plci) /* included before the ESC_MSGTYPE and MAXPARMSIDS has to be incremented */ /* SMSG is situated at the end because its 0 (for compatibility reasons */ /* (see Info_Mask Bit 4, first IE. then the message type) */ - word parms_id[] = + static const word parms_id[] = {MAXPARMSIDS, CPN, 0xff, DSA, OSA, BC, LLC, HLC, ESC_CAUSE, DSP, DT, CHA, UUI, CONG_RR, CONG_RNR, ESC_CHI, KEY, CHI, CAU, ESC_LAW, RDN, RDX, CONN_NR, RIN, NI, CAI, ESC_CR, @@ -4868,12 +4868,12 @@ static void sig_ind(PLCI *plci) /* 14 FTY repl by ESC_CHI */ /* 18 PI repl by ESC_LAW */ /* removed OAD changed to 0xff for future use, OAD is multiIE now */ - word multi_fac_id[] = {1, FTY}; - word multi_pi_id[] = {1, PI}; - word multi_CiPN_id[] = {1, OAD}; - word multi_ssext_id[] = {1, ESC_SSEXT}; + static const word multi_fac_id[] = {1, FTY}; + static const word multi_pi_id[] = {1, PI}; + static const word multi_CiPN_id[] = {1, OAD}; + static const word multi_ssext_id[] = {1, ESC_SSEXT}; - word multi_vswitch_id[] = {1, ESC_VSWITCH}; + static const word multi_vswitch_id[] = {1, ESC_VSWITCH}; byte *cau; word ncci; @@ -8926,7 +8926,7 @@ static void listen_check(DIVA_CAPI_ADAPTER *a) /* functions for all parameters sent in INDs */ /*------------------------------------------------------------------*/ -static void IndParse(PLCI *plci, word *parms_id, byte **parms, byte multiIEsize) +static void IndParse(PLCI *plci, const word *parms_id, byte **parms, byte multiIEsize) { word ploc; /* points to current location within packet */ byte w;