target: etm: fix check trace status
Current code tests a function pointer against a numeric value that
is the same enum type as returned by the pointed function.
Clearly the author was willing to call the function and check its
returned value.
Fix the check by calling the function.
Detected through 'sparse' tool.
Change-Id: I27d18d26c2c797160a397daa32835c199014b70b
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Checkpatch-ignore: GIT_COMMIT_ID
Fixes: 237e894805
("reworked etm/etb into a generic etm part with trace capture")
Reviewed-on: https://review.openocd.org/c/openocd/+/7599
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
parent
92c1bee18c
commit
329b10754a
|
@ -1706,7 +1706,7 @@ COMMAND_HANDLER(handle_etm_dump_command)
|
|||
return ERROR_FAIL;
|
||||
}
|
||||
|
||||
if (etm_ctx->capture_driver->status == TRACE_IDLE) {
|
||||
if (etm_ctx->capture_driver->status(etm_ctx) == TRACE_IDLE) {
|
||||
command_print(CMD, "trace capture wasn't enabled, no trace data captured");
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue