fixup! Simplify Synaptics driver

Remove "for (;;)" loop that never looped

It would either return or break at the end, so just remove the loop, it
is not needed.
This commit is contained in:
Benjamin Berg 2019-06-12 13:39:56 +02:00
parent e4bac112aa
commit 477df2a861

View file

@ -225,38 +225,35 @@ int bmkt_sensor_send_message(bmkt_sensor_t *sensor, uint8_t msg_id, uint8_t payl
bmkt_dbg_log("session_ctx->seq_num=%d, sensor->seq_num=%d", session_ctx->seq_num, sensor->seq_num); bmkt_dbg_log("session_ctx->seq_num=%d, sensor->seq_num=%d", session_ctx->seq_num, sensor->seq_num);
bmkt_op_set_state(sensor, BMKT_OP_STATE_START); bmkt_op_set_state(sensor, BMKT_OP_STATE_START);
for (;;)
ret = usb_get_command_buffer(&sensor->usb_xport, &cmd, &cmd_buf_len);
if (ret != BMKT_SUCCESS)
{ {
ret = usb_get_command_buffer(&sensor->usb_xport, &cmd, &cmd_buf_len); return BMKT_OUT_OF_MEMORY;
if (ret != BMKT_SUCCESS) }
{
return BMKT_OUT_OF_MEMORY;
}
/* MIS sensors send ACE commands encapsulated in FW commands*/ /* MIS sensors send ACE commands encapsulated in FW commands*/
cmd[0] = SENSOR_CMD_ACE_COMMAND; cmd[0] = SENSOR_CMD_ACE_COMMAND;
msg_len = cmd_buf_len - SENSOR_FW_CMD_HEADER_LEN; msg_len = cmd_buf_len - SENSOR_FW_CMD_HEADER_LEN;
if (session_ctx != NULL) if (session_ctx != NULL)
{ {
seq_num = session_ctx->seq_num; seq_num = session_ctx->seq_num;
} }
ret = bmkt_compose_message(&cmd[1], &msg_len, msg_id, seq_num, payload_size, payload); ret = bmkt_compose_message(&cmd[1], &msg_len, msg_id, seq_num, payload_size, payload);
if (ret != BMKT_SUCCESS) if (ret != BMKT_SUCCESS)
{ {
bmkt_dbg_log("Failed to compose ace message: %d", ret); bmkt_dbg_log("Failed to compose ace message: %d", ret);
goto cleanup; goto cleanup;
} }
ret = usb_send_command(&sensor->usb_xport, msg_len + SENSOR_FW_CMD_HEADER_LEN); ret = usb_send_command(&sensor->usb_xport, msg_len + SENSOR_FW_CMD_HEADER_LEN);
if (ret != BMKT_SUCCESS) if (ret != BMKT_SUCCESS)
{ {
bmkt_dbg_log("%s: failed to send ACE command: %d", __func__, ret); bmkt_dbg_log("%s: failed to send ACE command: %d", __func__, ret);
goto cleanup; goto cleanup;
}
break;
} }
cleanup: cleanup: