|
From: openocd-gerrit <ope...@us...> - 2026-10-16 07:28:10
|
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 30efa3e11f10b5eff0d2449c9fe0223c8f1e49ed (commit)
from 88a7138d344cab5227634c19e0abcfebc0c55948 (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 30efa3e11f10b5eff0d2449c9fe0223c8f1e49ed
Author: Marc Schink <de...@za...>
Date: Thu Aug 7 09:29:21 2025 +0200
flash/nor: Add error message to 'flash protect'
Provide an error message to the caller.
While at it, remove some unnecessary parentheses.
Change-Id: I5db1e5d25650e1f71425b5e41c26f3470dc1e032
Signed-off-by: Marc Schink <de...@za...>
Reviewed-on: https://review.openocd.org/c/openocd/+/9285
Tested-by: jenkins
Reviewed-by: Tomas Vanek <tom...@gm...>
Reviewed-by: Tarek BOCHKATI <tar...@gm...>
diff --git a/src/flash/nor/tcl.c b/src/flash/nor/tcl.c
index c792a7083..5b8bda884 100644
--- a/src/flash/nor/tcl.c
+++ b/src/flash/nor/tcl.c
@@ -384,15 +384,18 @@ COMMAND_HANDLER(handle_flash_protect_command)
}
retval = flash_driver_protect(p, set, first, last);
- if (retval == ERROR_OK) {
- command_print(CMD, "%s protection for %s %" PRIu32
- " through %" PRIu32 " on flash bank %d",
- (set) ? "set" : "cleared",
- (p->num_prot_blocks) ? "blocks" : "sectors",
- first, last, p->bank_number);
+ if (retval != ERROR_OK) {
+ command_print(CMD, "failed to %s protection", set ? "set" : "clear");
+ return retval;
}
- return retval;
+ command_print(CMD, "%s protection for %s %" PRIu32
+ " through %" PRIu32 " on flash bank %d",
+ set ? "set" : "cleared",
+ p->num_prot_blocks ? "blocks" : "sectors",
+ first, last, p->bank_number);
+
+ return ERROR_OK;
}
COMMAND_HANDLER(handle_flash_write_image_command)
-----------------------------------------------------------------------
Summary of changes:
src/flash/nor/tcl.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|