From patchwork Wed Jan 30 12:32:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Gang X-Patchwork-Id: 2067341 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 91B363FDD1 for ; Wed, 30 Jan 2013 12:35:05 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U0Wq8-0005bK-Pm; Wed, 30 Jan 2013 12:32:32 +0000 Received: from intranet.asianux.com ([58.214.24.6]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1U0Wq5-0005ai-0y for linux-arm-kernel@lists.infradead.org; Wed, 30 Jan 2013 12:32:29 +0000 Received: by intranet.asianux.com (Postfix, from userid 103) id 225B718402F4; Wed, 30 Jan 2013 20:32:26 +0800 (CST) X-Spam-Score: -100.8 X-Spam-Checker-Version: SpamAssassin 3.1.9 (2007-02-13) on intranet.asianux.com X-Spam-Level: X-Spam-Status: No, score=-100.8 required=5.0 tests=AWL,BAYES_00, RATWARE_GECKO_BUILD,USER_IN_WHITELIST autolearn=no version=3.1.9 Received: from [10.1.0.143] (unknown [219.143.36.82]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by intranet.asianux.com (Postfix) with ESMTP id C24DA1840236; Wed, 30 Jan 2013 20:32:25 +0800 (CST) Message-ID: <510912D5.5030505@asianux.com> Date: Wed, 30 Jan 2013 20:32:21 +0800 From: Chen Gang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Russell King - ARM Linux Subject: [PATCH] ARM:boot: support the command with COMMAND_LINE_SIZE - 1 useful chars X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130130_073229_402062_3E6DCFCD X-CRM114-Status: GOOD ( 16.55 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: richard.genoud@gmail.com, marc.zyngier@arm.com, linux-arm-kernel@lists.infradead.org, nico@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org originally, not support the command with COMMAND_LINE_SIZE - 1 useful chars. but in fact, we can support it: Signed-off-by: Chen Gang Reviewed-by: Richard Genoud --- arch/arm/boot/compressed/atags_to_fdt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/compressed/atags_to_fdt.c b/arch/arm/boot/compressed/atags_to_fdt.c index aabc02a..ed23ec2 100644 --- a/arch/arm/boot/compressed/atags_to_fdt.c +++ b/arch/arm/boot/compressed/atags_to_fdt.c @@ -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;