On 2022/2/24 21:30, Leon Romanovsky wrote: >> #define CMD_POLL_TOKEN 0xffff >> #define CMD_MAX_NUM 32 >> >> -static int hns_roce_cmd_mbox_post_hw(struct hns_roce_dev *hr_dev, u64 in_param, >> - u64 out_param, u32 in_modifier, u8 op, >> - u16 token, int event) >> +static int hns_roce_cmd_mbox_post_hw(struct hns_roce_dev *hr_dev, >> + struct hns_roce_mbox_msg *mbox_msg) >> { >> - return hr_dev->hw->post_mbox(hr_dev, in_param, out_param, in_modifier, >> - op, token, event); >> + return hr_dev->hw->post_mbox(hr_dev, mbox_msg); >> +} >> + >> +static void hns_roce_set_basic_mbox_msg(struct hns_roce_mbox_msg *mbox_msg, >> + u64 in_param, u64 out_param, u8 cmd, >> + unsigned long tag) >> +{ >> + mbox_msg->in_param = in_param; >> + mbox_msg->out_param = out_param; >> + mbox_msg->cmd = cmd; >> + mbox_msg->tag = tag; >> +} >> + >> +static void hns_roce_set_poll_mbox_msg(struct hns_roce_mbox_msg *mbox_msg) >> +{ >> + mbox_msg->event_en = 0; >> + mbox_msg->token = CMD_POLL_TOKEN; >> +} >> + >> +static void hns_roce_set_event_mbox_msg(struct hns_roce_mbox_msg *mbox_msg, >> + struct hns_roce_cmd_context *context) >> +{ >> + mbox_msg->event_en = 1; >> + mbox_msg->token = context->token; >> } > I don't see too much value in three functions above. They are called exactly once. > > Thanks > . > Yes, these assignment statements should not constitute a standalone function. Fix it in v2. Thanks, Wenpeng