Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 94718C433F5 for ; Mon, 7 Feb 2022 09:22:22 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 80B3E834E4; Mon, 7 Feb 2022 10:22:19 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1644225739; bh=UGmqICf9+TZ9UjGPfxFqQcoQ2W20TBqYah7HEb5XVyY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=U1ADBrBWAkuvAfX0ffQ63apQtcghFb7J4ucYntiutmyUsg/vHOO+HJzh65TWweTBh gct/72+S2ELpfNog0t8OFfEklnYvHN3pq7TH78zz9AysXrIAAnzBpVZ6/kroxIqzgT ZG24P8qBp1U+bOUbluix1SWLsYWJncbXFHYOTIL/2cbK2joDLX31mnsGfBjipqeNOm o9bXHL5EKu8njgfn2nHYZc6Mwq+NVLH6wObhZM/6wHXvasIzag+ZLr4sER1I9BColX NGmXmYXnPzBxmxnL7a1njhzHCICwoylQzA9pipcplTP0h2nPJB0iWf3KSpRCvL814o ywrHIf6JHB7TQ== Received: by phobos.denx.de (Postfix, from userid 109) id 11541834D2; Mon, 7 Feb 2022 10:22:18 +0100 (CET) Received: from mout-u-107.mailbox.org (mout-u-107.mailbox.org [IPv6:2001:67c:2050:1::465:107]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B4557834D2 for ; Mon, 7 Feb 2022 10:22:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp202.mailbox.org (unknown [91.198.250.118]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-107.mailbox.org (Postfix) with ESMTPS id 4Jsgdf2fkVz9sTm; Mon, 7 Feb 2022 10:22:14 +0100 (CET) Message-ID: <622458b1-8bcb-8c6b-a37c-e69a7d3bacef@denx.de> Date: Mon, 7 Feb 2022 10:22:07 +0100 MIME-Version: 1.0 Subject: Re: [PATCH] tools: kwboot: Allow to use -b without image path as the last getopt() option Content-Language: en-US To: =?UTF-8?Q?Pali_Roh=c3=a1r?= , =?UTF-8?Q?Marek_Beh=c3=ban?= , Marcel Ziswiler Cc: u-boot@lists.denx.de References: <20220207091224.10390-1-pali@kernel.org> From: Stefan Roese In-Reply-To: <20220207091224.10390-1-pali@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean On 2/7/22 10:12, Pali Rohár wrote: > Currently it is possible to call "kwboot -b -t /dev/ttyUSB0" but not to > call "kwboot -b /dev/ttyUSB0". > > Fix it by not trying to process the last argv[], which is non-getopt() > option (tty path) as the image path for -b. > > Fixes: c513fe47dca2 ("tools: kwboot: Allow to use option -b without image path") > Reported-by: Marcel Ziswiler > Signed-off-by: Pali Rohár > Reviewed-by: Marcel Ziswiler > Tested-by: Marcel Ziswiler Please correct me if I am wrong but AFAIU, this change makes it possible to use kwboot to also boot images on some of the Armada 64 bit platforms, as commented and tested by Marcel. If this is the case, could you please update the documentation or at least add a note with some comments to the commit text? Thanks, Stefan > --- > tools/kwboot.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/kwboot.c b/tools/kwboot.c > index 7737188f0d0a..68c0ef1f1b07 100644 > --- a/tools/kwboot.c > +++ b/tools/kwboot.c > @@ -1770,7 +1770,7 @@ main(int argc, char **argv) > bootmsg = kwboot_msg_boot; > if (prev_optind == optind) > goto usage; > - if (argv[optind] && argv[optind][0] != '-') > + if (optind < argc - 1 && argv[optind] && argv[optind][0] != '-') > imgpath = argv[optind++]; > break; > Viele Grüße, Stefan Roese -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de