diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2021-07-03 18:18:57 +0200 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2021-07-20 14:55:43 +0100 |
commit | 20b29b7767097f999fe2eb4f7fb6c2917e9f66a6 (patch) | |
tree | f6f060f100e0aae122b6e0fdbae2f342036bd7f7 /src/helper/fileio.c | |
parent | 28c24a5c41c47a66e9310912f88148814f730a25 (diff) | |
download | riscv-openocd-20b29b7767097f999fe2eb4f7fb6c2917e9f66a6.zip riscv-openocd-20b29b7767097f999fe2eb4f7fb6c2917e9f66a6.tar.gz riscv-openocd-20b29b7767097f999fe2eb4f7fb6c2917e9f66a6.tar.bz2 |
openocd: manually fix Yoda conditions
Fix the remaining Yoda conditions, detected by checkpatch but not
fixed automatically.
While there, apply minor style changes.
Change-Id: I6e1978b89c4d56a20aceaeb2b52968eb6384432a
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/6356
Tested-by: jenkins
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-by: Xiang W <wxjstz@126.com>
Diffstat (limited to 'src/helper/fileio.c')
-rw-r--r-- | src/helper/fileio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/helper/fileio.c b/src/helper/fileio.c index 5138fa1..d544b85 100644 --- a/src/helper/fileio.c +++ b/src/helper/fileio.c @@ -198,7 +198,7 @@ int fileio_read_u32(struct fileio *fileio, uint32_t *data) retval = fileio_local_read(fileio, sizeof(uint32_t), buf, &size_read); - if (ERROR_OK == retval && sizeof(uint32_t) != size_read) + if (retval == ERROR_OK && sizeof(uint32_t) != size_read) retval = -EIO; if (retval == ERROR_OK) *data = be_to_h_u32(buf); @@ -252,7 +252,7 @@ int fileio_write_u32(struct fileio *fileio, uint32_t data) retval = fileio_write(fileio, 4, buf, &size_written); - if (ERROR_OK == retval && size_written != sizeof(uint32_t)) + if (retval == ERROR_OK && size_written != sizeof(uint32_t)) retval = -EIO; return retval; |