Re: [PATCH V2 net-next 1/3] net: hns3: add command queue trace for hns3

From: Jijie Shao
Date: Fri Dec 15 2023 - 20:43:13 EST



on 2023/12/15 5:04, Simon Horman wrote:
On Thu, Dec 14, 2023 at 10:11:33PM +0800, Jijie Shao wrote:
From: Hao Lan <lanhao@xxxxxxxxxx>
...
@@ -470,10 +470,14 @@ static int hclge_comm_cmd_check_result(struct hclge_comm_hw *hw,
int hclge_comm_cmd_send(struct hclge_comm_hw *hw, struct hclge_desc *desc,
int num)
{
+ bool is_special = hclge_comm_is_special_opcode(desc->opcode);
struct hclge_comm_cmq_ring *csq = &hw->cmq.csq;
int ret;
int ntc;
hclge_comm_is_special_opcode takes a u16 value as it's argument,
but the type of desc->opcode is __le16. So perhaps this should be
(completely untested!):

struct hclge_comm_cmq_ring *csq = &hw->cmq.csq;
bool is_special;
...

is_special = hclge_comm_is_special_opcode(le16_to_cpu(desc->opcode));

Flagged by Sparse.

Thank you,
it will be fixed in v3

Jijie