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

From: Arnd Bergmann
Date: Mon Dec 04 2023 - 15:07:30 EST


On Mon, Dec 4, 2023, at 19:54, Christophe JAILLET wrote:
> Le 04/12/2023 à 09:57, Arnd Bergmann a écrit :
>>
>> Use dynamic allocation for the largest stack object instead. It
>> would be nice to rewrite this file to completely avoid the extra
>> buffer and just use the one that was already allocated by debugfs,
>> but that is a much larger change.
>>
> could :
> pos += scnprintf(buf + pos, len - pos, "%s", <something>);
> be more widely used to avoid the alloc()/free() + copy of strings?

Yes, I think that would help, but this is beyond what I trust
myself to do blindly.

Arnd