From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CADF9CA69 for ; Wed, 6 Dec 2023 03:23:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fzZ+bX6/" 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> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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!