|
From: <ge...@op...> - 2018-04-30 12:15:20
|
This is an automated email from Gerrit. Antonio Borneo (bor...@gm...) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/4512 -- gerrit commit 797720fdbc03ad34bd445f273c0d1009cd2d5bf8 Author: Antonio Borneo <bor...@gm...> Date: Thu Jan 22 23:22:07 2015 +0800 breakpoints: simplify the test to find a breakpoint The test is overly complicated and unreadable. Simplify it while keeping the exact same behaviour. Change-Id: I6b22291ca454e1eddeeab4024d3983dc4c603d3a Signed-off-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/breakpoints.c b/src/target/breakpoints.c index 7cf4a69..58bcc86 100644 --- a/src/target/breakpoints.c +++ b/src/target/breakpoints.c @@ -315,11 +315,8 @@ int breakpoint_remove_internal(struct target *target, target_addr_t address) struct breakpoint *breakpoint = target->breakpoints; while (breakpoint) { - if ((breakpoint->address == address) && (breakpoint->asid == 0)) - break; - else if ((breakpoint->address == 0) && (breakpoint->asid == address)) - break; - else if ((breakpoint->address == address) && (breakpoint->asid != 0)) + if ((breakpoint->address == address) || + (breakpoint->address == 0 && breakpoint->asid == address)) break; breakpoint = breakpoint->next; } -- |