Received: by 10.223.185.116 with SMTP id b49csp1124711wrg; Fri, 23 Feb 2018 12:21:31 -0800 (PST) X-Google-Smtp-Source: AH8x224GAYSrlRSeHuwlbI7MoXMEK8X/E/YHPUMcSCAOm3uHSh5YMjfTRfd8IYSnTEyzjElqc1u/ X-Received: by 10.101.87.199 with SMTP id q7mr2346919pgr.215.1519417291016; Fri, 23 Feb 2018 12:21:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519417290; cv=none; d=google.com; s=arc-20160816; b=sJxelJxBgSXg/8qKBOILlyiaxVlFrAW9cd15o3VESCy8BeaYXyhRIzzHT0y6XG03Ol I+7Deeb7AGqxDYNMDt8fOcV+i3y86qG7cP5h/nPfPacfWUYmIryLht6P4M7s17OfGaFg a/KWH/XcG7MciA01td5anZxA+8YpqfsuuSBC0qEKXjJcOPllPiQBGfnxzuaVHUek1aZ1 6nFcPYimmBrm8uu8qBDl23J+qUZGwoFRbOEjq6BQrur0X2MzJoJ7TwnVZmoT4FNk2M5S f18FreABb5+yzjccRmNLHQQN8iHaL77wp+l9OojipAIfiWs842zwMMbf7TYXNy4c2Y/f PHaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=LpAvb3exHv9sW2myZfrb3//izbpBRPwM00Ox+H2Ekaw=; b=SF8FAO7tqVNV95FkwTJe8X5kxq96w7wpDI8BGP4PzyinOh3huKmBJCBI6+dD2+xtYO +yZijZkInK/ui+P58auZ3ZX8lv08GBj+Ubsw2QcLlbK3F+1iwyWdR9/pJCqgW0D4zKKg V5pgC/9F2vgD3yViyzZfBmdnyhIbkQ7J/oPhqFuGciqZYLkdQZbUO1s1Gfp87v4wpdly J5zArsfXU08AUbXVQBbMEeJ2+yNG7l8Im5Yo5mmZVpD8zniH3bDc/khP9ad5+FWre7F4 0igEOd9M989jCW2eW4csBVRN+tlN7JPEZUnojcVhVQQMnf4RrbSx7mRQ8aYRC/5ZWkY2 0wJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b15si1910864pgs.318.2018.02.23.12.21.16; Fri, 23 Feb 2018 12:21:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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 linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754320AbeBWSjI (ORCPT + 99 others); Fri, 23 Feb 2018 13:39:08 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:39516 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932493AbeBWSjE (ORCPT ); Fri, 23 Feb 2018 13:39:04 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 8AC7010C4; Fri, 23 Feb 2018 18:39:03 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , "David S. Miller" Subject: [PATCH 4.4 136/193] ISDN: eicon: reduce stack size of sig_ind function Date: Fri, 23 Feb 2018 19:26:09 +0100 Message-Id: <20180223170347.100101187@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170325.997716448@linuxfoundation.org> References: <20180223170325.997716448@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann commit 27d807180ae0a9e50d90adf9b22573c21be904c2 upstream. 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: Greg Kroah-Hartman --- drivers/isdn/hardware/eicon/message.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) --- 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_ADAPT /* 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;