Commit 4e599ddd authored by Hao Chen's avatar Hao Chen Committed by David S. Miller

net: hns3: add comments for hclge_dbg_fill_content()

When we use hclge_dbg_fill_content() to fill contents with
specific format according to struct hclge_dbg_item *items,
it may cause content cover due to unreasonable items.

So add comments to explain how to avoid it.
Signed-off-by: default avatarHao Chen <chenhao288@hisilicon.com>
Signed-off-by: default avatarGuangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5ac4f180
...@@ -77,6 +77,10 @@ static const struct hclge_dbg_reg_type_info hclge_dbg_reg_info[] = { ...@@ -77,6 +77,10 @@ static const struct hclge_dbg_reg_type_info hclge_dbg_reg_info[] = {
.cmd = HCLGE_OPC_DFX_TQP_REG } }, .cmd = HCLGE_OPC_DFX_TQP_REG } },
}; };
/* make sure: len(name) + interval >= maxlen(item data) + 2,
* for example, name = "pkt_num"(len: 7), the prototype of item data is u32,
* and print as "%u"(maxlen: 10), so the interval should be at least 5.
*/
static void hclge_dbg_fill_content(char *content, u16 len, static void hclge_dbg_fill_content(char *content, u16 len,
const struct hclge_dbg_item *items, const struct hclge_dbg_item *items,
const char **result, u16 size) const char **result, u16 size)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment