|
From: OpenOCD-Gerrit <ope...@us...> - 2022-10-08 07:52:47
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via 0cedf10f8fd618b78190ce32a40f26dec0fb8253 (commit)
from 759d581fdeec3063475349b2c4ac75140032c0e1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 0cedf10f8fd618b78190ce32a40f26dec0fb8253
Author: Evgeniy Naydanov <evg...@sy...>
Date: Wed Sep 14 17:56:20 2022 +0300
Remove duplicate of a counter in hwthread_update_threads
There is no need to count number of examined threads twice.
Signed-off-by: Evgeniy Naydanov <evg...@sy...>
Change-Id: Id32ead853d1ddcd4e67062d6f795700feb20cb4b
Reviewed-on: https://review.openocd.org/c/openocd/+/7223
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
Reviewed-by: Tomas Vanek <va...@fb...>
diff --git a/src/rtos/hwthread.c b/src/rtos/hwthread.c
index e5eaf425f..bdd5835c2 100644
--- a/src/rtos/hwthread.c
+++ b/src/rtos/hwthread.c
@@ -78,7 +78,6 @@ static int hwthread_fill_thread(struct rtos *rtos, struct target *curr, int thre
static int hwthread_update_threads(struct rtos *rtos)
{
int threads_found = 0;
- int thread_list_size = 0;
struct target_list *head;
struct target *target;
int64_t current_thread = 0;
@@ -100,13 +99,13 @@ static int hwthread_update_threads(struct rtos *rtos)
if (!target_was_examined(curr))
continue;
- ++thread_list_size;
+ ++threads_found;
}
} else
- thread_list_size = 1;
+ threads_found = 1;
/* create space for new thread details */
- rtos->thread_details = malloc(sizeof(struct thread_detail) * thread_list_size);
+ rtos->thread_details = malloc(sizeof(struct thread_detail) * threads_found);
if (target->smp) {
/* loop over all threads */
@@ -171,13 +170,10 @@ static int hwthread_update_threads(struct rtos *rtos)
default:
break;
}
-
- threads_found++;
}
} else {
hwthread_fill_thread(rtos, target, threads_found);
current_thread = threadid_from_target(target);
- threads_found++;
}
rtos->thread_count = threads_found;
-----------------------------------------------------------------------
Summary of changes:
src/rtos/hwthread.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|