Re: [PATCH] [v2] net: hns3: reduce stack usage in hclge_dbg_dump_tm_pri()

From: Jakub Kicinski
Date: Tue Dec 05 2023 - 22:23:52 EST


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!