This is an automated email from Gerrit.

"Antonio Borneo <borneo.anto...@gmail.com>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9037

-- gerrit

commit f541252c184adc60b452d8fd078ee7fba5dee79a
Author: Antonio Borneo <borneo.anto...@gmail.com>
Date:   Sat Jun 28 14:02:50 2025 +0200

    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.anto...@gmail.com>

diff --git a/src/rtos/linux.c b/src/rtos/linux.c
index 7ee97668ef..785be13fd8 100644
--- a/src/rtos/linux.c
+++ b/src/rtos/linux.c
@@ -1293,38 +1293,32 @@ static int linux_thread_packet(struct connection 
*connection, char const *packet
                        break;
                case 'q':
 
-                       if (strncmp(packet, "qSymbol", 7) == 0) {
+                       if (!strncmp(packet, "qSymbol", 7)) {
                                if (rtos_qsymbol(connection, packet, 
packet_size) == 1) {
                                        linux_compute_virt2phys(target,
                                                        
target->rtos->symbols[INIT_TASK].address);
                                }
-
-                               break;
-                       } else if (strncmp(packet, "qfThreadInfo", 12) == 0) {
+                       } else if (!strncmp(packet, "qfThreadInfo", 12)) {
                                if (!linux_os->thread_list) {
                                        retval = linux_gdb_thread_packet(target,
                                                        connection,
                                                        packet,
                                                        packet_size);
-                                       break;
                                } else {
                                        retval = linux_gdb_thread_update(target,
                                                        connection,
                                                        packet,
                                                        packet_size);
-                                       break;
                                }
-                       } else if (strncmp(packet, "qsThreadInfo", 12) == 0) {
+                       } else if (!strncmp(packet, "qsThreadInfo", 12)) {
                                gdb_put_packet(connection, "l", 1);
-                               break;
-                       } else if (strncmp(packet, "qThreadExtraInfo,", 17) == 
0) {
+                       } else if (!strncmp(packet, "qThreadExtraInfo,", 17)) {
                                linux_thread_extra_info(target, connection, 
packet,
                                                packet_size);
-                               break;
                        } else {
                                retval = GDB_THREAD_PACKET_NOT_CONSUMED;
-                               break;
                        }
+                       break;
 
                case 'Q':
                        /* previously response was : thread not found

-- 

Reply via email to