Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2570426rdb; Mon, 4 Dec 2023 00:53:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IHPSIOeA9Zy9poRekFj9bu5OmEayHEm9P4IUw0ORTfq5nyo+RXf/UVGFOAiJYGes6IMbSdO X-Received: by 2002:a17:90b:33c7:b0:286:a4fc:9f5c with SMTP id lk7-20020a17090b33c700b00286a4fc9f5cmr1002646pjb.25.1701680012275; Mon, 04 Dec 2023 00:53:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701680012; cv=none; d=google.com; s=arc-20160816; b=lPKAV+iH5TFuJt08R1a3KqWt9MPMgKE1uu+isq5k7UyWmDYhvNTyeFpQl7Oa6aQCxu tOS7IH1GNossVnxVXNW2J9fdYcorQGgVVtIs67QciSL5Lo3u9x/seSL+4Vr1RqKVNoNb lJBtS6l3YMevvPzuGrvufQXDdI0QK6o7F82+tByC8hmJBpBOufk0PyCbe3v32ognIk3N RfpVq5pcBHD0r4uLsBx3n5kQT3nvoS3U95msLoVU71M7UwzU8IlEZYCcA//ojvfjXmWl TBFpqK1lIjjhX4BEKNZ7d3vV5zOxA4ELTYSsTBp2fgC/WZaUWpRM5ivgc4U7vECAdZEg S2TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=Br16u4cy0eZPz1W9bH0/WzZdoUCb+AJe3NiNEj7iIgY=; fh=wFkPjPVWuukDAZ9SH12fFk8+kZbYFSm1ho9Qq/+THzo=; b=D5H/NNmORTELhkXWhdhZcXvQF0y05OyF2w5HelSEk7/JTK9zwGNJjYpzERhUFbfQC0 Xh4HLiFZhj0ogd5kmfPHnX2gcyUKn4a/R1pNtpyXYPfmXVayqvVEPsmmxpLnHVqOT2lD 11NliKAPUSr1lmBEtGvIncI3HHO7wDqqBJ4h8Hk0qYjgVXI5BzB19rSjNVYs9nSg1jww OUcyqMn3loNa4TecWuMvp8w6VHumw4PHBFfAt3tcg91fHFMnYAnTlfmrU8d5tpg4NLfk Y6OILhmI+iyqRjhLpDjm1a6RzH8FLvVWQrf6h/v4+i4DHe6eM9pH0ILxkK/5wdvLYsgV m6kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b="JW/UsSWk"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=g68+rVPu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id q4-20020a17090a9f4400b002868fb621f0si2458050pjv.67.2023.12.04.00.53.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 00:53:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b="JW/UsSWk"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=g68+rVPu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 04E5C80816BE; Mon, 4 Dec 2023 00:53:30 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229714AbjLDIxQ (ORCPT + 99 others); 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 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 04 Dec 2023 00:53:30 -0800 (PST) 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