|
From: openocd-gerrit <ope...@us...> - 2023-08-03 20:24:42
|
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 bab8b8c9eb7c0e892eaa375cb1f388a75165c627 (commit)
from a5108240f9e12633fea400f92d96cc75e03c86ca (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 bab8b8c9eb7c0e892eaa375cb1f388a75165c627
Author: Marek Vrbka <mar...@co...>
Date: Tue Jun 6 15:32:09 2023 +0200
register: refactor register_cache_invalidate()
register_cache_invalidate() is written a way which uses
pointer arithmetic, which makes it harder to read. This patch
replaces it with more readable way to iterate over array of
structs.
Change-Id: Ia420f70a3bb6998c690c8c600c71301dca9f9dbf
Signed-off-by: Marek Vrbka <mar...@co...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7735
Reviewed-by: Tomas Vanek <va...@fb...>
Tested-by: jenkins
Reviewed-by: Jan Matyas <jan...@co...>
diff --git a/src/target/register.c b/src/target/register.c
index 228712586..e4f22f8e9 100644
--- a/src/target/register.c
+++ b/src/target/register.c
@@ -93,9 +93,8 @@ void register_unlink_cache(struct reg_cache **cache_p, const struct reg_cache *c
/** Marks the contents of the register cache as invalid (and clean). */
void register_cache_invalidate(struct reg_cache *cache)
{
- struct reg *reg = cache->reg_list;
-
- for (unsigned int n = cache->num_regs; n != 0; n--, reg++) {
+ for (unsigned int n = 0; n < cache->num_regs; n++) {
+ struct reg *reg = &cache->reg_list[n];
if (!reg->exist)
continue;
reg->valid = false;
-----------------------------------------------------------------------
Summary of changes:
src/target/register.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|