NAND/CORE: fix clang warning
authorAntonio Borneo <borneo.antonio@gmail.com>
Sun, 23 Oct 2011 04:02:57 +0000 (12:02 +0800)
committerØyvind Harboe <oyvindharboe@gmail.com>
Sun, 23 Oct 2011 14:32:11 +0000 (14:32 +0000)
The fix is inline with the Linux coding style that forbids
assignment in if condition

Change-Id: I42a371d6adfdf3b3fb867705211c47d89776ee2a
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/85
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
src/flash/nand/core.c

index 03deabd..d9bb7de 100644 (file)
@@ -598,7 +598,8 @@ int nand_erase(struct nand_device *nand, int first_block, int last_block)
                        return ERROR_NAND_OPERATION_TIMEOUT;
                }
 
-               if ((retval = nand_read_status(nand, &status)) != ERROR_OK)
+               retval = nand_read_status(nand, &status);
+               if (retval != ERROR_OK)
                {
                        LOG_ERROR("couldn't read status");
                        return ERROR_NAND_OPERATION_FAILED;