From fab0dcd7e6cb8cfbf63cb41f0978902371d30205 Mon Sep 17 00:00:00 2001 From: Spencer Oliver Date: Tue, 31 Jan 2012 11:07:53 +0000 Subject: build: cleanup src/flash/nand directory Change-Id: I21bb466a35168cf04743f5baafac9fef50d01707 Signed-off-by: Spencer Oliver Reviewed-on: http://openocd.zylin.com/419 Tested-by: jenkins --- src/flash/nand/arm_io.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'src/flash/nand/arm_io.c') diff --git a/src/flash/nand/arm_io.c b/src/flash/nand/arm_io.c index 431ac908..cf494766 100644 --- a/src/flash/nand/arm_io.c +++ b/src/flash/nand/arm_io.c @@ -30,7 +30,6 @@ #include #include - /** * Copies code to a working area. This will allocate room for the code plus the * additional amount requested if the working area pointer is null. @@ -44,8 +43,8 @@ * @return Success or failure of the operation */ static int arm_code_to_working_area(struct target *target, - const uint32_t *code, unsigned code_size, - unsigned additional, struct working_area **area) + const uint32_t *code, unsigned code_size, + unsigned additional, struct working_area **area) { uint8_t code_buf[code_size]; unsigned i; @@ -61,7 +60,7 @@ static int arm_code_to_working_area(struct target *target, if (NULL == *area) { retval = target_alloc_working_area(target, size, area); if (retval != ERROR_OK) { - LOG_DEBUG("%s: no %d byte buffer", __FUNCTION__, (int) size); + LOG_DEBUG("%s: no %d byte buffer", __func__, (int) size); return ERROR_NAND_NO_BUFFER; } } @@ -95,13 +94,13 @@ static int arm_code_to_working_area(struct target *target, */ int arm_nandwrite(struct arm_nand_data *nand, uint8_t *data, int size) { - struct target *target = nand->target; - struct arm_algorithm algo; - struct arm *arm = target->arch_info; - struct reg_param reg_params[3]; - uint32_t target_buf; - uint32_t exit_var = 0; - int retval; + struct target *target = nand->target; + struct arm_algorithm algo; + struct arm *arm = target->arch_info; + struct reg_param reg_params[3]; + uint32_t target_buf; + uint32_t exit_var = 0; + int retval; /* Inputs: * r0 NAND data address (byte wide) @@ -121,9 +120,8 @@ int arm_nandwrite(struct arm_nand_data *nand, uint8_t *data, int size) if (nand->op != ARM_NAND_WRITE || !nand->copy_area) { retval = arm_code_to_working_area(target, code, sizeof(code), nand->chunk_size, &nand->copy_area); - if (retval != ERROR_OK) { + if (retval != ERROR_OK) return retval; - } } nand->op = ARM_NAND_WRITE; @@ -206,9 +204,8 @@ int arm_nandread(struct arm_nand_data *nand, uint8_t *data, uint32_t size) if (nand->op != ARM_NAND_READ || !nand->copy_area) { retval = arm_code_to_working_area(target, code, sizeof(code), nand->chunk_size, &nand->copy_area); - if (retval != ERROR_OK) { + if (retval != ERROR_OK) return retval; - } } nand->op = ARM_NAND_READ; @@ -246,4 +243,3 @@ int arm_nandread(struct arm_nand_data *nand, uint8_t *data, uint32_t size) return retval; } - -- cgit v1.2.3-18-g5258