Skip to contentSkip to conversation

ARM:boot: support the command with COMMAND_LINE_SIZE - 1 useful chars

PATCH New Chen Gang 2 participants 3 messages Jan 30, 2013 – Feb 1, 2013 Arm (32-bit)

lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH 1/1 ARM:boot: support the command with COMMAND_LINE_SIZE - 1 useful chars

originally, not support the command with COMMAND_LINE_SIZE - 1 useful chars. but in fact, we can support it:

---
 arch/arm/boot/compressed/atags_to_fdt.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/compressed/atags_to_fdt.c +2 -2
index aabc02a..ed23ec2 100644
@@ -63,7 +63,7 @@ static void merge_fdt_bootargs(void *fdt, const char *fdt_cmdline)
 	/* copy the fdt command line into the buffer */
 	fdt_bootargs = getprop(fdt, "/chosen", "bootargs", &len);
 	if (fdt_bootargs)
-		if (len < COMMAND_LINE_SIZE) {
+		if (len <= COMMAND_LINE_SIZE) {
 			memcpy(ptr, fdt_bootargs, len);
 			/* len is the length of the string
 			 * including the NULL terminator */
@@ -73,7 +73,7 @@ static void merge_fdt_bootargs(void *fdt, const char *fdt_cmdline)
 	/* and append the ATAG_CMDLINE */
 	if (fdt_cmdline) {
 		len = strlen(fdt_cmdline);
-		if (ptr - cmdline + len + 2 < COMMAND_LINE_SIZE) {
+		if (ptr - cmdline + len + 2 <= COMMAND_LINE_SIZE) {
 			*ptr++ = ' ';
 			memcpy(ptr, fdt_cmdline, len);
 			ptr += len;
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/1 ARM:boot: support the command with COMMAND_LINE_SIZE - 1 useful chars

Quoted 4 lines · Chen Gang

originally, not support the command with COMMAND_LINE_SIZE - 1 useful chars. but in fact, we can support it:

You're right.

Quoted 29 lines
---
 arch/arm/boot/compressed/atags_to_fdt.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/compressed/atags_to_fdt.c +2 -2
index aabc02a..ed23ec2 100644
@@ -63,7 +63,7 @@ static void merge_fdt_bootargs(void *fdt, const char *fdt_cmdline)
 	/* copy the fdt command line into the buffer */
 	fdt_bootargs = getprop(fdt, "/chosen", "bootargs", &len);
 	if (fdt_bootargs)
-		if (len < COMMAND_LINE_SIZE) {
+		if (len <= COMMAND_LINE_SIZE) {
 			memcpy(ptr, fdt_bootargs, len);
 			/* len is the length of the string
 			 * including the NULL terminator */
@@ -73,7 +73,7 @@ static void merge_fdt_bootargs(void *fdt, const char *fdt_cmdline)
 	/* and append the ATAG_CMDLINE */
 	if (fdt_cmdline) {
 		len = strlen(fdt_cmdline);
-		if (ptr - cmdline + len + 2 < COMMAND_LINE_SIZE) {
+		if (ptr - cmdline + len + 2 <= COMMAND_LINE_SIZE) {
 			*ptr++ = ' ';
 			memcpy(ptr, fdt_cmdline, len);
 			ptr += len;
Signature · 1 line
1.7.10.4
author
#2 lore raw

PATCH 1/1 ARM:boot: support the command with COMMAND_LINE_SIZE - 1 useful chars

? 2013?01?30? 23:40, Richard GENOUD ??:

Quoted 7 lines · Chen Gang
Quoted 4 lines
Quoted 4 lines

originally, not support the command with COMMAND_LINE_SIZE - 1 useful chars. but in fact, we can support it:

You're right.

ok, thank you.

:-)

Signature · 3 lines
Chen Gang

Asianux Corporation