Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp718998rdb; Tue, 5 Dec 2023 19:23:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IGf/WP8AAyroZ6EllM15VP5hF9cwYTLgLzW+v+MfACRqzmGI2S/Ksa3ROhw5g791UVPs9aH X-Received: by 2002:a17:902:ced2:b0:1d0:9a64:e511 with SMTP id d18-20020a170902ced200b001d09a64e511mr233601plg.73.1701833039581; Tue, 05 Dec 2023 19:23:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701833039; cv=none; d=google.com; s=arc-20160816; b=SseBgsOZd4TSGaBpo5tM6XDaFPJToptG33uzB698O30zM3w/j4nmEDk/gaQyQo+rjj 8JXIV6H/1W0DimEJEWwe+9uym9q6Nk/E6YKpJA8gvZpFj0xhe/MeVJG8U50epcG526Nt +Aqu48gS23zcaYwhALXpsiZLDzgou16YbPx80SuA2DRZb9YVLdZcHvswnEkcC29A9XLF FTBNJyvbD7JtF+wG9vXgw92wHVCzBwsjXSaBaDrXFwpy/qnqVF+/Ubp+b3zO+pFxmX6M /K2oPH68X6ZbJTvTkyrSQoG03lnyf35v9BnHIiGYAVGTwlV0gqxOnlq7+/4WfVyAFPMN a5HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=f4Rago9e7P3SeCYAPtOCxb8E2ofwUEGOKMSEMyhHSrY=; fh=xre0cEZ680O+fine7Tl5OFl3GI2LHPEA+9jOer19/Lc=; b=OPnnhYA5KWTZ813IotkFm1Km5wCuV1tB0QDrjNe0c2bKwg1vhsWyEoMV1AFHfMkrIK 2gA71lHuZta/Ghkjxb2nN/+5a+tqaf92uwv2alzXHih1SqlFACtAY9oFQyfh/+nPSoA0 9xpFbsLZzPEp9JXiP2Qto0bUPhd8eHxJj+H0zKgDZoP68gPKFwqDn3CKnsTqEbJxvP0U Yy44dFkt3ZbezMln0Tzz/EyDxC20WPo35QH8ri1ddf84V4+eFDC5P541TXhUW5Y/Newi MXO6LtQlBsyNN97PYMQ/S6TouTcGF+B53OptuAMOu0gauJib/AZfqvBkMzQffup+7d5I EtVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="fzZ+bX6/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id h5-20020a170902f54500b001d09c96ba1esi4743561plf.452.2023.12.05.19.23.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 19:23:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="fzZ+bX6/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 316568048E53; Tue, 5 Dec 2023 19:23:57 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229904AbjLFDXn (ORCPT + 99 others); Tue, 5 Dec 2023 22:23:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229521AbjLFDXm (ORCPT ); Tue, 5 Dec 2023 22:23:42 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CDA91BD for ; Tue, 5 Dec 2023 19:23:48 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AFF90C433C8; Wed, 6 Dec 2023 03:23:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701833028; bh=0icMTsZffc3HsofoVIIMmjh5hP1g6SqIcxw749v3E9E=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=fzZ+bX6/C+v8bCMDCwhFV48Ta3s6YrX5ZoYHymZP8IlclkW0Izsp085wVdQC2s9vc AOav5FbkiRVeDUNao10HWQA23RJLyYwlKSAnHU6l5IxwhujVyewsDCCbwgj3A3IIRf Jj2Cr+YtK+g4aIP0P4Q4+gWb7i/KBqVuL2TzfUNBREmRm8tPQBG1pktUVn0phmOu52 /9w6j+vjmv7vPkVNa4eyiOJbLXg84YlBRyUSDq/ym45PgDBzXRal2jZCI+ShRk70hH Hu5iGt2dR6vzctYiaW3z5/iLro2p2/T/+7wGmGqil8b6X9hd2o6c5sXeKgpC80L8Xx mjGyYUK4FSiig== Date: Tue, 5 Dec 2023 19:23:46 -0800 From: Jakub Kicinski To: Jijie Shao Cc: Arnd Bergmann , Yisen Zhuang , Salil Mehta , "David S. Miller" , Eric Dumazet , Paolo Abeni , Arnd Bergmann , Hao Chen , , Subject: Re: [PATCH] [v2] net: hns3: reduce stack usage in hclge_dbg_dump_tm_pri() Message-ID: <20231205192346.4409ee16@kernel.org> In-Reply-To: <7df7cfcb-d39b-4643-a378-a18b8d2b5b35@huawei.com> References: <20231204085735.4112882-1-arnd@kernel.org> <7df7cfcb-d39b-4643-a378-a18b8d2b5b35@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 05 Dec 2023 19:23:57 -0800 (PST) On Mon, 4 Dec 2023 22:50:55 +0800 Jijie Shao wrote: > > static int hclge_dbg_dump_tm_pri(struct hclge_dev *hdev, char *buf, int len) > > { > > - char data_str[ARRAY_SIZE(tm_pri_items)][HCLGE_DBG_DATA_STR_LEN]; > > + char *data_str; > > We want to define variables in an inverted triangle based on the code length. > so, "char *data_str" should move four lines down. > > struct hclge_tm_shaper_para c_shaper_para, p_shaper_para; > char *result[ARRAY_SIZE(tm_pri_items)], *sch_mode_str; > char content[HCLGE_DBG_TM_INFO_LEN]; > u8 pri_num, sch_mode, weight, i, j; > char *data_str; > int pos, ret; I took the liberty of fixing this when applying. Don't want this to fall thru the cracks. Applied to net-next now, thanks!