From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2062DC4167B for ; Mon, 4 Dec 2023 08:53:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229899AbjLDIxQ (ORCPT ); Mon, 4 Dec 2023 03:53:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229666AbjLDIxP (ORCPT ); Mon, 4 Dec 2023 03:53:15 -0500 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B61C8A5; Mon, 4 Dec 2023 00:53:21 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 329673200A47; Mon, 4 Dec 2023 03:53:20 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Mon, 04 Dec 2023 03:53:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1701679999; x=1701766399; bh=Br 16u4cy0eZPz1W9bH0/WzZdoUCb+AJe3NiNEj7iIgY=; b=JW/UsSWkD948Fg19mR voYDi7cVd2O4lWh8Ou5OAttoXr4tMOquxA6BcBpkEZkx9abHHkoeKXvGy0SxUOjT 3GYJ43X9b0+JEZ65+uhe/xpnaGzhr1q3vKjCQ441IY8flwvFXvdz/nxlMBTkKbRN Nnn29dj5mdNOdTM+P7+7an9qAMBms1D4NVY9wi5+S0tSyFT/jnTH3stup76UG5Pu NKoN9t3fxS6UGxypCXAI28vCSZ8+glOFMVbWm5DFcHLbbP6xG7DwDvAI5zhr8ccC 0cjNMlXqsDLxjh/otHquIIdbI4EE85o2pVnA4Fsg4hJJhIkeg3HIDZ7kN9bpSl82 44uw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1701679999; x=1701766399; bh=Br16u4cy0eZPz 1W9bH0/WzZdoUCb+AJe3NiNEj7iIgY=; b=g68+rVPu15+TVdPRo4ftiIvKidQAT 6Iyi4FAu/e2Mbp6yrDAajRE9qZoA3fCnNsOKR6i7810rovSuriQ/nz/DXysH97gP RE+jAgM86VA3Pkt/BmACKVinI+VLNCeuHrfbYW+6EQVaw+rtjj/zr6Dh5v62JU30 iwyiurjQkxAn3A996NxWCft9cEUeb1Lwip7JXTzQZ0zpI9WDA1lTndgNvlc5vnoX KFgEIOc6OUFKNFqGHdxoSasWXP/f12/W1gVff8bgun63HR80H6dpZ1/IkneRrzaW kY92X7GSwbjJW8oiqAc35ikZgHWlJxlKIDA+ZvaYpYXENC40XbGew5YDw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudejhedguddvgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdet rhhnugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrg htthgvrhhnpeffheeugeetiefhgeethfejgfdtuefggeejleehjeeutefhfeeggefhkedt keetffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grrhhnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 70EE1B60089; Mon, 4 Dec 2023 03:53:19 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1178-geeaf0069a7-fm-20231114.001-geeaf0069 MIME-Version: 1.0 Message-Id: In-Reply-To: <5402aa8a-a20f-4d28-bd36-3b88702ea6ae@huawei.com> References: <20231204072932.1077878-1-arnd@kernel.org> <5402aa8a-a20f-4d28-bd36-3b88702ea6ae@huawei.com> Date: Mon, 04 Dec 2023 09:52:58 +0100 From: "Arnd Bergmann" To: "Jijie Shao" , "Arnd Bergmann" , "Yisen Zhuang" , "Salil Mehta" , "David S . Miller" , "Eric Dumazet" , "Jakub Kicinski" , "Paolo Abeni" Cc: "Hao Chen" , Netdev , linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: hns3: reduce stack usage in hclge_dbg_dump_tm_pri() Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 4, 2023, at 09:31, Jijie Shao wrote: > on 2023/12/4 15:29, Arnd Bergmann wrote: >> From: Arnd Bergmann >> >> >> @@ -981,7 +981,7 @@ static const struct hclge_dbg_item tm_pri_items[] = { >> >> 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; >> 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]; >> @@ -991,9 +991,13 @@ static int hclge_dbg_dump_tm_pri(struct hclge_dev *hdev, char *buf, int len) >> ret = hclge_tm_get_pri_num(hdev, &pri_num); >> if (ret) >> return ret; > > Thanks, > But it would be better if there is an empty line here. ok > > all exception condition also need to free memory before return. eg: Indeed, I'll send a v2 in a bit. Arnd