}
/* Regular parsing */
- if (elm->state == ELM327_STATE_RECEIVING
- && elm327_parse_frame(elm, len)) {
+ if (elm->state == ELM327_STATE_RECEIVING &&
+ elm327_parse_frame(elm, len)) {
/* Parse an error line. */
elm327_parse_error(elm, len);
/* Reconfigure ELM327 step by step as indicated by elm->cmds_todo */
if (test_bit(ELM327_TX_DO_INIT, &elm->cmds_todo)) {
snprintf(local_txbuf, sizeof(local_txbuf),
- "%s",
- *elm->next_init_cmd);
+ "%s",
+ *elm->next_init_cmd);
elm->next_init_cmd++;
if (!(*elm->next_init_cmd)) {
} else if (test_and_clear_bit(ELM327_TX_DO_SILENT_MONITOR, &elm->cmds_todo)) {
snprintf(local_txbuf, sizeof(local_txbuf),
- "ATCSM%i\r",
- !(!(elm->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)));
+ "ATCSM%i\r",
+ !(!(elm->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)));
} else if (test_and_clear_bit(ELM327_TX_DO_RESPONSES, &elm->cmds_todo)) {
snprintf(local_txbuf, sizeof(local_txbuf),
- "ATR%i\r",
- !(elm->can.ctrlmode & CAN_CTRLMODE_LISTENONLY));
+ "ATR%i\r",
+ !(elm->can.ctrlmode & CAN_CTRLMODE_LISTENONLY));
} else if (test_and_clear_bit(ELM327_TX_DO_CAN_CONFIG, &elm->cmds_todo)) {
snprintf(local_txbuf, sizeof(local_txbuf),
- "ATPC\r");
+ "ATPC\r");
set_bit(ELM327_TX_DO_CAN_CONFIG_PART2, &elm->cmds_todo);
} else if (test_and_clear_bit(ELM327_TX_DO_CAN_CONFIG_PART2, &elm->cmds_todo)) {
snprintf(local_txbuf, sizeof(local_txbuf),
- "ATPB%04X\r",
- elm->can_config);
+ "ATPB%04X\r",
+ elm->can_config);
} else if (test_and_clear_bit(ELM327_TX_DO_CANID_29BIT_HIGH, &elm->cmds_todo)) {
snprintf(local_txbuf, sizeof(local_txbuf),
- "ATCP%02X\r",
- (frame->can_id & CAN_EFF_MASK) >> 24);
+ "ATCP%02X\r",
+ (frame->can_id & CAN_EFF_MASK) >> 24);
} else if (test_and_clear_bit(ELM327_TX_DO_CANID_29BIT_LOW, &elm->cmds_todo)) {
snprintf(local_txbuf, sizeof(local_txbuf),
- "ATSH%06X\r",
- frame->can_id & CAN_EFF_MASK & ((1 << 24) - 1));
+ "ATSH%06X\r",
+ frame->can_id & CAN_EFF_MASK & ((1 << 24) - 1));
} else if (test_and_clear_bit(ELM327_TX_DO_CANID_11BIT, &elm->cmds_todo)) {
snprintf(local_txbuf, sizeof(local_txbuf),
- "ATSH%03X\r",
- frame->can_id & CAN_SFF_MASK);
+ "ATSH%03X\r",
+ frame->can_id & CAN_SFF_MASK);
} else if (test_and_clear_bit(ELM327_TX_DO_CAN_DATA, &elm->cmds_todo)) {
if (frame->can_id & CAN_RTR_FLAG) {
* Some chips don't send them at all.
*/
snprintf(local_txbuf, sizeof(local_txbuf),
- "ATRTR\r");
+ "ATRTR\r");
} else {
/* Send a regular CAN data frame */
int i;
for (i = 0; i < frame->len; i++) {
snprintf(&local_txbuf[2 * i], sizeof(local_txbuf),
- "%02X",
- frame->data[i]);
+ "%02X",
+ frame->data[i]);
}
snprintf(&local_txbuf[2 * i], sizeof(local_txbuf),
- "\r");
+ "\r");
}
elm->drop_next_line = 1;
elm327_uart_side_failure(elm);
spin_unlock_bh(&elm->lock);
return;
- } else {
- elm->txleft -= written;
- elm->txhead += written;
}
+
+ elm->txleft -= written;
+ elm->txhead += written;
}
if (!elm->txleft) {