|
From: openocd-gerrit <ope...@us...> - 2026-09-13 04:52:00
|
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 b5230e2a0612cd5853b41e557e6d03dd182c83b7 (commit)
from fee41114fc652d6058b8c015db4c659d0464f852 (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 b5230e2a0612cd5853b41e557e6d03dd182c83b7
Author: Tomas Vanek <va...@fb...>
Date: Sat Sep 5 10:08:51 2026 +0200
flash/nor: describe flash driver verify method as optional
While on it refactor flash_driver_verify() not to hide
calling different procedures behind ? : operator.
Use if/else instead. No functional change.
Change-Id: I07d632c2eae53f8aa9ef4cf64ecc592c6a56ae74
Signed-off-by: Tomas Vanek <va...@fb...>
Reviewed-on: https://review.openocd.org/c/openocd/+/9962
Reviewed-by: Antonio Borneo <bor...@gm...>
Tested-by: jenkins
diff --git a/src/flash/nor/core.c b/src/flash/nor/core.c
index 93c8b7124..34698299b 100644
--- a/src/flash/nor/core.c
+++ b/src/flash/nor/core.c
@@ -129,8 +129,10 @@ int flash_driver_verify(struct flash_bank *bank,
{
int retval;
- retval = bank->driver->verify ? bank->driver->verify(bank, buffer, offset, count) :
- default_flash_verify(bank, buffer, offset, count);
+ if (bank->driver->verify)
+ retval = bank->driver->verify(bank, buffer, offset, count);
+ else
+ retval = default_flash_verify(bank, buffer, offset, count);
if (retval != ERROR_OK) {
LOG_ERROR("verify failed in bank at " TARGET_ADDR_FMT " starting at 0x%8.8" PRIx32,
bank->base, offset);
diff --git a/src/flash/nor/driver.h b/src/flash/nor/driver.h
index 48cf2ad36..0d55824e2 100644
--- a/src/flash/nor/driver.h
+++ b/src/flash/nor/driver.h
@@ -149,6 +149,9 @@ struct flash_driver {
* "bank->base + offset", while the physical address is
* dependent upon current target MMU mappings.
*
+ * If the flash does not need device specific verification,
+ * set method to NULL and default_flash_verify() will be used.
+ *
* @param bank The bank to verify
* @param buffer The data bytes to verify against.
* @param offset The offset into the chip to verify.
-----------------------------------------------------------------------
Summary of changes:
src/flash/nor/core.c | 6 ++++--
src/flash/nor/driver.h | 3 +++
2 files changed, 7 insertions(+), 2 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|