Merge "aboot: update command line in common code"
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index 2e3d475..adeca41 100644
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -345,18 +345,15 @@
 {
 	int cmdline_length = 0;
 	int n;
-	unsigned char *cmdline_final = NULL;
 	char *dest;
 
-	cmdline_final = update_cmdline(cmdline);
-
-	cmdline_length =strlen((const char*)cmdline_final);
+	cmdline_length = strlen((const char*)cmdline);
 	n = (cmdline_length + 4) & (~3);
 
 	*ptr++ = (n / 4) + 2;
 	*ptr++ = 0x54410009;
 	dest = (char *) ptr;
-	while ((*dest++ = *cmdline_final++));
+	while ((*dest++ = *cmdline++));
 	ptr += (n / 4);
 
 	return ptr;
@@ -393,6 +390,7 @@
 		const char *cmdline, unsigned machtype,
 		void *ramdisk, unsigned ramdisk_size)
 {
+	unsigned char *final_cmdline;
 #if DEVICE_TREE
 	int ret = 0;
 #endif
@@ -402,11 +400,13 @@
 
 	ramdisk = PA(ramdisk);
 
+	final_cmdline = update_cmdline((const char*)cmdline);
+
 #if DEVICE_TREE
 	dprintf(INFO, "Updating device tree: start\n");
 
 	/* Update the Device Tree */
-	ret = update_device_tree((void *)tags, cmdline, ramdisk, ramdisk_size);
+	ret = update_device_tree((void *)tags, final_cmdline, ramdisk, ramdisk_size);
 	if(ret)
 	{
 		dprintf(CRITICAL, "ERROR: Updating Device Tree Failed \n");
@@ -416,7 +416,7 @@
 	dprintf(INFO, "Updating device tree: done\n");
 #else
 	/* Generating the Atags */
-	generate_atags(tags, cmdline, ramdisk, ramdisk_size);
+	generate_atags(tags, final_cmdline, ramdisk, ramdisk_size);
 #endif
 
 	dprintf(INFO, "booting linux @ %p, ramdisk @ %p (%d)\n",
diff --git a/platform/msm_shared/dev_tree.c b/platform/msm_shared/dev_tree.c
index 82a4dab..40f1f30 100644
--- a/platform/msm_shared/dev_tree.c
+++ b/platform/msm_shared/dev_tree.c
@@ -36,7 +36,6 @@
 #include <platform.h>
 #include <board.h>
 
-extern unsigned char *update_cmdline(const char * cmdline);
 extern int target_is_emmc_boot(void);
 extern uint32_t target_dev_tree_mem(void *fdt, uint32_t memory_node_offset);
 
@@ -369,7 +368,6 @@
 {
 	int ret = 0;
 	uint32_t offset;
-	unsigned char *final_cmdline;
 
 	/* Check the device tree header */
 	ret = fdt_check_header(fdt);
@@ -411,8 +409,7 @@
 
 	offset = ret;
 	/* Adding the cmdline to the chosen node */
-	final_cmdline = update_cmdline((const char*)cmdline);
-	ret = fdt_setprop_string(fdt, offset, (const char*)"bootargs", (const void*)final_cmdline);
+	ret = fdt_setprop_string(fdt, offset, (const char*)"bootargs", (const void*)cmdline);
 	if (ret)
 	{
 		dprintf(CRITICAL, "ERROR: Cannot update chosen node [bootargs]\n");