diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2021-07-03 17:18:53 +0200 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2021-07-24 10:38:31 +0100 |
commit | c0c7d6fe8b04f521a7262303083ef5eb6ebaf4e5 (patch) | |
tree | ceb6cb092f7bbf31a9ca0677c6a67364d4a52ed2 /src/flash/nor/cc26xx.c | |
parent | 54e699b2601036e384a124657aa1fbdd9ff2dc87 (diff) | |
download | riscv-openocd-c0c7d6fe8b04f521a7262303083ef5eb6ebaf4e5.zip riscv-openocd-c0c7d6fe8b04f521a7262303083ef5eb6ebaf4e5.tar.gz riscv-openocd-c0c7d6fe8b04f521a7262303083ef5eb6ebaf4e5.tar.bz2 |
openocd: fix Yoda conditions with checkpatch
The new checkpatch can automatically fix the code, but this
feature is still error prone and not complete.
Patch generated automatically through the new checkpatch with
flags "--types CONSTANT_COMPARISON --fix-inplace".
Some Yoda condition is detected by checkpatch but not fixed; it
will be fixed manually in a following commit.
Change-Id: Ifaaa1159e63dbd1db6aa3c017125df9874fa9703
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/6355
Tested-by: jenkins
Diffstat (limited to 'src/flash/nor/cc26xx.c')
-rw-r--r-- | src/flash/nor/cc26xx.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/flash/nor/cc26xx.c b/src/flash/nor/cc26xx.c index 0895798..f6b5632 100644 --- a/src/flash/nor/cc26xx.c +++ b/src/flash/nor/cc26xx.c @@ -148,7 +148,7 @@ static int cc26xx_init(struct flash_bank *bank) return retval; /* Confirm the defined working address is the area we need to use */ - if (CC26XX_ALGO_BASE_ADDRESS != cc26xx_bank->working_area->address) + if (cc26xx_bank->working_area->address != CC26XX_ALGO_BASE_ADDRESS) return ERROR_TARGET_RESOURCE_NOT_AVAILABLE; /* Write flash helper algorithm into target memory */ @@ -211,7 +211,7 @@ static int cc26xx_mass_erase(struct flash_bank *bank) int retval; - if (TARGET_HALTED != target->state) { + if (target->state != TARGET_HALTED) { LOG_ERROR("Target not halted"); return ERROR_TARGET_NOT_HALTED; } @@ -275,7 +275,7 @@ static int cc26xx_erase(struct flash_bank *bank, unsigned int first, uint32_t length; int retval; - if (TARGET_HALTED != target->state) { + if (target->state != TARGET_HALTED) { LOG_ERROR("Target not halted"); return ERROR_TARGET_NOT_HALTED; } @@ -327,7 +327,7 @@ static int cc26xx_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t index; int retval; - if (TARGET_HALTED != target->state) { + if (target->state != TARGET_HALTED) { LOG_ERROR("Target not halted"); return ERROR_TARGET_NOT_HALTED; } |