diff options
author | Øyvind Harboe <oyvind.harboe@zylin.com> | 2011-12-13 23:44:34 +0100 |
---|---|---|
committer | Spencer Oliver <spen@spen-soft.co.uk> | 2011-12-20 16:57:34 +0000 |
commit | a30a4f0fc76b72936a6557e08d6b55b3a46eaafd (patch) | |
tree | e552caa91437102da07fc33d1e748f0fce25d62b /src/jtag/core.c | |
parent | cb90d32e386a7489d31136997209c61e9559ff5e (diff) | |
download | riscv-openocd-a30a4f0fc76b72936a6557e08d6b55b3a46eaafd.zip riscv-openocd-a30a4f0fc76b72936a6557e08d6b55b3a46eaafd.tar.gz riscv-openocd-a30a4f0fc76b72936a6557e08d6b55b3a46eaafd.tar.bz2 |
jtag: make caller always allocate buffer
simplifies the API and there is only one remaining user at this point.
Is the implementation busted where the check does not actually happen
now?
Change-Id: I776a43766f5576a08df320f6fe41a2750d101bde
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/264
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src/jtag/core.c')
-rw-r--r-- | src/jtag/core.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/jtag/core.c b/src/jtag/core.c index 3090ddd..529e9bc 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -417,12 +417,8 @@ static void jtag_add_scan_check(struct jtag_tap *active, void (*jtag_add_scan)(s for (int i = 0; i < in_num_fields; i++) { struct scan_field *field = &in_fields[i]; - field->allocated = 0; - field->modified = 0; - if (field->check_value || field->in_value) - continue; - interface_jtag_add_scan_check_alloc(field); - field->modified = 1; + /* caller must provide in_buffer if needed for callback */ + assert((field->check_value == NULL) || (field->in_value != NULL)); } jtag_add_scan(active, in_num_fields, in_fields, state); @@ -437,14 +433,6 @@ static void jtag_add_scan_check(struct jtag_tap *active, void (*jtag_add_scan)(s (jtag_callback_data_t)in_fields[i].check_mask, (jtag_callback_data_t)in_fields[i].num_bits); } - if (in_fields[i].allocated) - { - free(in_fields[i].in_value); - } - if (in_fields[i].modified) - { - in_fields[i].in_value = NULL; - } } } |