forked from auracaster/openocd
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:
@@ -611,7 +611,7 @@ static int read_all_core_hw_regs(struct target *t)
|
||||
unsigned i;
|
||||
struct x86_32_common *x86_32 = target_to_x86_32(t);
|
||||
for (i = 0; i < (x86_32->cache->num_regs); i++) {
|
||||
if (NOT_AVAIL_REG == regs[i].pm_idx)
|
||||
if (regs[i].pm_idx == NOT_AVAIL_REG)
|
||||
continue;
|
||||
err = read_hw_reg(t, regs[i].id, ®val, 1);
|
||||
if (err != ERROR_OK) {
|
||||
@@ -630,7 +630,7 @@ static int write_all_core_hw_regs(struct target *t)
|
||||
unsigned i;
|
||||
struct x86_32_common *x86_32 = target_to_x86_32(t);
|
||||
for (i = 0; i < (x86_32->cache->num_regs); i++) {
|
||||
if (NOT_AVAIL_REG == regs[i].pm_idx)
|
||||
if (regs[i].pm_idx == NOT_AVAIL_REG)
|
||||
continue;
|
||||
err = write_hw_reg(t, i, 0, 1);
|
||||
if (err != ERROR_OK) {
|
||||
|
||||
Reference in New Issue
Block a user