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/+/9036

-- gerrit

commit 7a6da1761fe5dfdcbfe2fedea81a452430935dce
Author: Antonio Borneo <borneo.anto...@gmail.com>
Date:   Sat Jun 28 01:09:22 2025 +0200

    rtos: linux: drop useless code
    
    Since the initial code merged in 2012, the last case of the switch
    has a useless test on 'retval' that is not assigned in the case.
    Since 'retval' is initialized to ERROR_OK, the condition is always
    false.
    
    Drop the check on 'retval'.
    While there, drop the useless parenthesis around the 'case' and
    add the 'break' statement.
    
    Change-Id: I3f673b5e10f6b28a4a74881b8a06a71b58afb422
    Signed-off-by: Antonio Borneo <borneo.anto...@gmail.com>

diff --git a/src/rtos/linux.c b/src/rtos/linux.c
index 4ca02605ed..7ee97668ef 100644
--- a/src/rtos/linux.c
+++ b/src/rtos/linux.c
@@ -1332,7 +1332,7 @@ static int linux_thread_packet(struct connection 
*connection, char const *packet
                        retval = GDB_THREAD_PACKET_NOT_CONSUMED;
                        break;
                case 'c':
-               case 's': {
+               case 's':
                        if (linux_os->threads_lookup == 1) {
                                ct = linux_os->current_threads;
 
@@ -1357,11 +1357,7 @@ static int linux_thread_packet(struct connection 
*connection, char const *packet
                                LOG_INFO("threads_needs_update = 1");
                                linux_os->threads_needs_update = 1;
                        }
-               }
-
-               /* if a packet handler returned an error, exit input loop */
-               if (retval != ERROR_OK)
-                       return retval;
+                       break;
        }
 
        return retval;

-- 

Reply via email to