forked from auracaster/openocd
rtos: linux: prepare for aligning switch and case statements
To prepare for aligning switch and case statements, fix in advance some checkpatch error due to existing code: - fix useless 'else' after 'break', by moving the 'break' statement. While there: - modify the checks on strncmp(). Change-Id: I123f3c0e3999669440845c946e4839d7288e8d91 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/9037 Tested-by: jenkins
This commit is contained in:
+5
-11
@@ -1293,38 +1293,32 @@ static int linux_thread_packet(struct connection *connection, char const *packet
|
|||||||
break;
|
break;
|
||||||
case 'q':
|
case 'q':
|
||||||
|
|
||||||
if (strncmp(packet, "qSymbol", 7) == 0) {
|
if (!strncmp(packet, "qSymbol", 7)) {
|
||||||
if (rtos_qsymbol(connection, packet, packet_size) == 1) {
|
if (rtos_qsymbol(connection, packet, packet_size) == 1) {
|
||||||
linux_compute_virt2phys(target,
|
linux_compute_virt2phys(target,
|
||||||
target->rtos->symbols[INIT_TASK].address);
|
target->rtos->symbols[INIT_TASK].address);
|
||||||
}
|
}
|
||||||
|
} else if (!strncmp(packet, "qfThreadInfo", 12)) {
|
||||||
break;
|
|
||||||
} else if (strncmp(packet, "qfThreadInfo", 12) == 0) {
|
|
||||||
if (!linux_os->thread_list) {
|
if (!linux_os->thread_list) {
|
||||||
retval = linux_gdb_thread_packet(target,
|
retval = linux_gdb_thread_packet(target,
|
||||||
connection,
|
connection,
|
||||||
packet,
|
packet,
|
||||||
packet_size);
|
packet_size);
|
||||||
break;
|
|
||||||
} else {
|
} else {
|
||||||
retval = linux_gdb_thread_update(target,
|
retval = linux_gdb_thread_update(target,
|
||||||
connection,
|
connection,
|
||||||
packet,
|
packet,
|
||||||
packet_size);
|
packet_size);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
} else if (strncmp(packet, "qsThreadInfo", 12) == 0) {
|
} else if (!strncmp(packet, "qsThreadInfo", 12)) {
|
||||||
gdb_put_packet(connection, "l", 1);
|
gdb_put_packet(connection, "l", 1);
|
||||||
break;
|
} else if (!strncmp(packet, "qThreadExtraInfo,", 17)) {
|
||||||
} else if (strncmp(packet, "qThreadExtraInfo,", 17) == 0) {
|
|
||||||
linux_thread_extra_info(target, connection, packet,
|
linux_thread_extra_info(target, connection, packet,
|
||||||
packet_size);
|
packet_size);
|
||||||
break;
|
|
||||||
} else {
|
} else {
|
||||||
retval = GDB_THREAD_PACKET_NOT_CONSUMED;
|
retval = GDB_THREAD_PACKET_NOT_CONSUMED;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case 'Q':
|
case 'Q':
|
||||||
/* previously response was : thread not found
|
/* previously response was : thread not found
|
||||||
|
|||||||
Reference in New Issue
Block a user