diff options
author | Spencer Oliver <spen@spen-soft.co.uk> | 2013-10-24 23:26:51 +0100 |
---|---|---|
committer | Spencer Oliver <spen@spen-soft.co.uk> | 2013-11-07 21:38:49 +0000 |
commit | edfb677d3466a0d88fe9bd5ec1d8785a41b6bc4e (patch) | |
tree | ca2c571b896e0e8806fce283ac4816035417a17b /src/flash/nand | |
parent | 2ad2554e522c610af85e6ea2385eb824c3a89104 (diff) |
target: use target_buffer_set_u32_array
Attempt to use target_buffer_set_u32_array to convert to target endian
arrays rather reimplementing code.
This also removed cfi_fix_code_endian as its functionality is also
repeated.
Change-Id: I7c359dbe46ea791cd5f6fb18d8b0fb6895c599d3
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/1783
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Diffstat (limited to 'src/flash/nand')
-rw-r--r-- | src/flash/nand/arm_io.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/flash/nand/arm_io.c b/src/flash/nand/arm_io.c index 67b15088..d54958ad 100644 --- a/src/flash/nand/arm_io.c +++ b/src/flash/nand/arm_io.c @@ -48,7 +48,6 @@ static int arm_code_to_working_area(struct target *target, unsigned additional, struct working_area **area) { uint8_t code_buf[code_size]; - unsigned i; int retval; unsigned size = code_size + additional; @@ -67,8 +66,7 @@ static int arm_code_to_working_area(struct target *target, } /* buffer code in target endianness */ - for (i = 0; i < code_size / 4; i++) - target_buffer_set_u32(target, code_buf + i * 4, code[i]); + target_buffer_set_u32_array(target, code_buf, code_size / 4, code); /* copy code to work area */ retval = target_write_memory(target, (*area)->address, |