aboutsummaryrefslogtreecommitdiff
path: root/src/target/arc_mem.c
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2021-07-03 16:47:35 +0200
committerAntonio Borneo <borneo.antonio@gmail.com>2021-07-20 14:55:24 +0100
commit28c24a5c41c47a66e9310912f88148814f730a25 (patch)
tree803cf52a0c8f5a0687f5c7fef402b08cf337ebac /src/target/arc_mem.c
parentbba48b057cdc4f26721e06a5310652dcf0e55873 (diff)
downloadriscv-openocd-28c24a5c41c47a66e9310912f88148814f730a25.zip
riscv-openocd-28c24a5c41c47a66e9310912f88148814f730a25.tar.gz
riscv-openocd-28c24a5c41c47a66e9310912f88148814f730a25.tar.bz2
openocd: fix simple cases of Yoda condition
There are ~900 Yoda conditions to be aligned to the coding style. For recurrent Yoda conditions it's preferable using a trivial script in order to minimize the review effort. E.g. comparison of uppercase macro/enum with lowercase variable: - ...(ERROR_OK == retval)... + ...(retval == ERROR_OK)... Patch generated automatically with the command: sed -i \ 's/(\([A-Z][A-Z0-9_]*\) \([=!]=\) \([a-z][a-z0-9_]*\))/(\3 \2 \1)/g' \ $(find src/ -type f) While there, remove the braces {} around a single statement block to prevent warning from checkpatch. Change-Id: If585b0a4b4578879c87b2dd74d9e0025e275ec6b Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6354 Tested-by: jenkins Reviewed-by: Xiang W <wxjstz@126.com>
Diffstat (limited to 'src/target/arc_mem.c')
-rw-r--r--src/target/arc_mem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/target/arc_mem.c b/src/target/arc_mem.c
index 9676269..81d1ab2 100644
--- a/src/target/arc_mem.c
+++ b/src/target/arc_mem.c
@@ -281,7 +281,7 @@ int arc_mem_read(struct target *target, target_addr_t address, uint32_t size,
/* arc_..._read_mem with size 4/2 returns uint32_t/uint16_t in host */
/* endianness, but byte array should represent target endianness */
- if (ERROR_OK == retval) {
+ if (retval == ERROR_OK) {
switch (size) {
case 4:
target_buffer_set_u32_array(target, buffer, count,