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
This commit is contained in:
@@ -119,7 +119,7 @@ COMMAND_HELPER(nand_fileio_parse_args, struct nand_fileio_state *state,
|
||||
nand_fileio_init(state);
|
||||
|
||||
unsigned minargs = need_size ? 4 : 3;
|
||||
if (CMD_ARGC < minargs)
|
||||
if (minargs > CMD_ARGC)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
|
||||
struct nand_device *nand;
|
||||
@@ -141,7 +141,7 @@ COMMAND_HELPER(nand_fileio_parse_args, struct nand_fileio_state *state,
|
||||
}
|
||||
}
|
||||
|
||||
if (CMD_ARGC > minargs) {
|
||||
if (minargs < CMD_ARGC) {
|
||||
for (unsigned i = minargs; i < CMD_ARGC; i++) {
|
||||
if (!strcmp(CMD_ARGV[i], "oob_raw"))
|
||||
state->oob_format |= NAND_OOB_RAW;
|
||||
|
||||
Reference in New Issue
Block a user