arm7: add missing braces around an if()

Spotted by gcc:

    arm7_9_common.c: In function ‘arm7_9_unset_breakpoint’:
    arm7_9_common.c:353:4: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
        if (current_instr == arm7_9->thumb_bkpt)
        ^~
    arm7_9_common.c:356:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
         if (retval != ERROR_OK)
         ^~

The logic won't change once the braces have been added, as the new 'retval'
check only makes sense within the if().

Change-Id: I6a303e118f2150e5eb25c9268ad06de5d8a533b2
Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
Reviewed-on: http://openocd.zylin.com/3477
Tested-by: jenkins
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
__archive__
Aleksander Morgado 2016-05-11 09:58:47 +02:00 committed by Freddie Chopin
parent 4d4d22e9d2
commit 866774a690
1 changed files with 2 additions and 2 deletions

View File

@ -350,12 +350,12 @@ static int arm7_9_unset_breakpoint(struct target *target, struct breakpoint *bre
if (retval != ERROR_OK)
return retval;
current_instr = target_buffer_get_u16(target, (uint8_t *)&current_instr);
if (current_instr == arm7_9->thumb_bkpt)
if (current_instr == arm7_9->thumb_bkpt) {
retval = target_write_memory(target,
breakpoint->address, 2, 1, breakpoint->orig_instr);
if (retval != ERROR_OK)
return retval;
}
}
if (--arm7_9->sw_breakpoint_count == 0) {