Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4701766pxb; Tue, 28 Sep 2021 02:00:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQ9zr7fSg4CSgohu0CAC4dzJocMIWQXBEYrgUGwmHJFSRQWmCkRXCMUsI7uOvHVENGIPHW X-Received: by 2002:a50:e183:: with SMTP id k3mr6368551edl.22.1632819649432; Tue, 28 Sep 2021 02:00:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632819649; cv=none; d=google.com; s=arc-20160816; b=DszseQHcVaMErdio832cNtJ5KWbTr2n5g7phxekSnLcWsue6DE/fntzlsIci5WYewF yqI8uomob3zkjv033MpLeDHDzTe3CgPA2o4X1/jPAvjfiF6l7yM3l85XoZCyAG/LS9B6 OKtSCmZkzTvE3AsWtkWqlO+v5AnzhBuxS3g1LK3e4f3sa7jqPBZ3UqEV99GXYK6TKcFo 73bodofnGNnMplOPmiKD4H+cCUYv2VlXAt1JtAyMn12PceRRfQ7pGp6uWiiFCmb4w0yl jRlJroTbaV6U7tBE6XgmahxewU/tmskeasScOsQHY3V+mHVNvuCQGfFkSbmaaBD1MrOr vSQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=c/6TQ4FjR7+nsmMv4YtLfC1g/nHiXVARdxCvMHF7U6c=; b=1JQhD6cEVbuaXYR9RkwkQ3GeH4qvrh/eJY3C0eMFYhFwKKNGSrjzF9vo9kssql58BH FzA+MVm5B+ku164HvWjho8mjfq2avcGosBh6IouD86pE0I4A2UlKfrwku8tW/XetoPMM YjBHk+KqZZwsezKez8orv4G29y+O4HG/ylJhLGs3Y3i84NVhUGjLj8d7TKib0twN+oth p7TlpqDFyJPA/H+yIvOQ7aBekE8X3zvIBD7JxmCWpUytc8MFUQiIiiug1F1y4Va9grkm gzO8wdamv5nciBTpS0HMXnoG1jn0rdhsbWHHiOjFF7D7lLDwx1D15+qE11nzfl1rlr9E 7gAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XmMzcsw8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 12si21723368eja.426.2021.09.28.02.00.24; Tue, 28 Sep 2021 02:00:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XmMzcsw8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239749AbhI1JAL (ORCPT + 99 others); Tue, 28 Sep 2021 05:00:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:42248 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239716AbhI1JAK (ORCPT ); Tue, 28 Sep 2021 05:00:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 688006113E; Tue, 28 Sep 2021 08:58:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632819511; bh=/LGa6ol03F+gR8eOJlhzdRh431oy2qqGn62TyLrNt4o=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=XmMzcsw8b72SmPUyhRK65YCZ/97MG+nocrjNEEgf/A3gRa+cNudoDirffGR1pjuX4 O+ufgxoA+7fe9PtZMGhr1KTOr7b00jc+F45hgM4lfGtgsJ1h3NXYrjHHi5P5BjOsLH wPNqSVKqaXpO5+PTRC+IbBjfjjgI1eOk6tqh8xybZpCu7suJFQD8o1a1noqWee89yu ogEXhgxxBqe5HWGi3YznACbZutfvp2CDAgyEKejH3Hxc+tjXjBAGbGXcbKxiLi9yeN LyG1OBYCaO9X3prvvKC0NK4Xhles1YcJST4gFf9hIiVfIjXJQqQB2G5pJuiXVYIf4B m5u6DWYHpbS1w== Received: by mail-wm1-f50.google.com with SMTP id r83-20020a1c4456000000b0030cfc00ca5fso1550109wma.2; Tue, 28 Sep 2021 01:58:31 -0700 (PDT) X-Gm-Message-State: AOAM533Y5m5d0mT20QAlJWeUuKGB24yAFqROwnC71P0DkWctuiPxe4/f sDwDoRWeW8Ofp0cEiSRBrbTTMKLcHfkPCNRVYd8= X-Received: by 2002:a1c:4b0c:: with SMTP id y12mr3483320wma.35.1632819509973; Tue, 28 Sep 2021 01:58:29 -0700 (PDT) MIME-Version: 1.0 References: <20210927095006.868305-1-arnd@kernel.org> In-Reply-To: From: Arnd Bergmann Date: Tue, 28 Sep 2021 10:58:14 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] net: hns3: fix hclge_dbg_dump_tm_pg() stack usage To: "huangguangbin (A)" Cc: Yisen Zhuang , Salil Mehta , "David S. Miller" , Jakub Kicinski , Arnd Bergmann , Huazhong Tan , Yufeng Mo , Jiaran Zhang , Jian Shen , Networking , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 28, 2021 at 10:34 AM huangguangbin (A) wrote: > On 2021/9/27 17:49, Arnd Bergmann wrote: From: Arnd Bergmann > > +static int hclge_dbg_dump_tm_pg(struct hclge_dev *hdev, char *buf, int len) > > +{ > > + int ret; > > + char *data_str = kcalloc(ARRAY_SIZE(tm_pg_items), > > + HCLGE_DBG_DATA_STR_LEN, GFP_KERNEL); > > + > Hi Arnd, thanks your modification, according to linux code style, should the code be written as follow? > > char *data_str; > int ret; > > data_str = kcalloc(ARRAY_SIZE(tm_pg_items), > HCLGE_DBG_DATA_STR_LEN, GFP_KERNEL); That's actually one of the versions I tried, but I didn't really like any of them, so I went with the shorter version. Sending a v2 now with that changed black. Arnd