dfu: mmc: fs: Fix format accepted by ext4write command
authorLukasz Majewski <l.majewski@samsung.com>
Thu, 20 Feb 2014 09:29:18 +0000 (10:29 +0100)
committerChanho Park <chanho61.park@samsung.com>
Fri, 24 Jul 2015 07:29:52 +0000 (16:29 +0900)
The commit:

"EXT4: Fix number base handling of "ext4write" command"
 SHA1: f7740f7712b8638f08b83a7e5d00bc1d6bb086a9

Cleaned up the ext4write command format.

This commit shall be regarded as a follow up, since the DFU subsystem is
using those commands for its normal operation.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
drivers/dfu/dfu_mmc.c

index 12111de6f0f6b01bea524444c07b30ee301487e7..4862b5745cd47fd1be88bbdc686f8a26753bda8a 100644 (file)
@@ -85,16 +85,12 @@ static int mmc_file_op(enum dfu_op op, struct dfu_entity *dfu,
                        op == DFU_OP_READ ? "load" : "write",
                        dfu->data.mmc.dev, dfu->data.mmc.part,
                        (unsigned int) buf, dfu->name);
-               if (op == DFU_OP_WRITE)
-                       sprintf(cmd_buf + strlen(cmd_buf), " %lx", *len);
                break;
        case DFU_FS_EXT4:
                sprintf(cmd_buf, "ext4%s mmc %d:%d 0x%x /%s",
                        op == DFU_OP_READ ? "load" : "write",
                        dfu->data.mmc.dev, dfu->data.mmc.part,
                        (unsigned int) buf, dfu->name);
-               if (op == DFU_OP_WRITE)
-                       sprintf(cmd_buf + strlen(cmd_buf), " %ld", *len);
                break;
        default:
                printf("%s: Layout (%s) not (yet) supported!\n", __func__,
@@ -102,6 +98,9 @@ static int mmc_file_op(enum dfu_op op, struct dfu_entity *dfu,
                return -1;
        }
 
+       if (op == DFU_OP_WRITE)
+               sprintf(cmd_buf + strlen(cmd_buf), " %lx", *len);
+
        debug("%s: %s 0x%p\n", __func__, cmd_buf, cmd_buf);
 
        ret = run_command(cmd_buf, 0);