Thread (3 messages) flat view 3 messages, 2 authors, 2021-09-28

Re: [PATCH] net: hns3: fix hclge_dbg_dump_tm_pg() stack usage

From: Arnd Bergmann <arnd@kernel.org>
Date: 2021-09-28 08:58:35
Also in: lkml

On Tue, Sep 28, 2021 at 10:34 AM huangguangbin (A)
[off-list ref] wrote:
On 2021/9/27 17:49, Arnd Bergmann wrote: From: Arnd Bergmann [off-list ref]
quoted
+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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help