From mboxrd@z Thu Jan 1 00:00:00 1970 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 7A49DC43334 for ; Sun, 17 Jul 2022 08:13:25 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3E83E83F3D; Sun, 17 Jul 2022 10:13:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="i1SYhe56"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4A19683D13; Sun, 17 Jul 2022 10:13:00 +0200 (CEST) Received: from mail-vs1-xe36.google.com (mail-vs1-xe36.google.com [IPv6:2607:f8b0:4864:20::e36]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EBED183D10 for ; Sun, 17 Jul 2022 10:12:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-vs1-xe36.google.com with SMTP id d187so7898571vsd.10 for ; Sun, 17 Jul 2022 01:12:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:from:in-reply-to:references:date:message-id :subject:to:cc; bh=2QFo00nmSIoycdgl2VVUSpZXJxr0XtJudMD79uBlKFo=; b=i1SYhe56gEJdqPoqaGja98bsV7AlWnmC1hi2UKjJxCtIQENv0UgrgOI1TkOMUKIT9p QCJh/3Jps4QCalMvZtLOR5NMMs9Nv6gS5q9IN+nSKAKMD1BDq78hUJ+ALfgquy/xFZVt RBgyrvqfnac127jnAP1jVxpI+//A41+8DZPFo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:sender:from:in-reply-to:references :date:message-id:subject:to:cc; bh=2QFo00nmSIoycdgl2VVUSpZXJxr0XtJudMD79uBlKFo=; b=SGJgzTP38T2u3vDdKqiOc58LoRcveeWtahuan594oq3pMxFvZ7iTEcOnlgAtdEiZdY COpZICBrFyunclDLyhjTc+g9fIrze7+dtbCE41Es4493o/r7EX56mp9bXS+WLdW78RQ5 gyCU5XDV4/iaaQ9nyeh1E9FuORYXNeZTNb0P/JnoP6zqtwqdncNjv0EpSGtKlg41AHAy 47zle862ZExHJNpnEY08bopm6oxBi2X6wGWmmgl0xxe7VGaRe1gFqARfobofB/D7Z8wI AEIlJK9csCp+ERRvnGwmT/Ao3eh/hwQ23ubc8HUW92RCzaox/+IVq/kd83J2yN19vlOt +9Ng== X-Gm-Message-State: AJIora9WfKA3XJFnROs4w6WoxYGajGoBnth49AwQmV1iVTJNVFD/QIoy fWTBLugxgvXcUuNDr7YgM+GDCICQLLbLbojvPAIveg== X-Google-Smtp-Source: AGRyM1uNhK8FDM4w1r6S3xs2vcMS6He/aXi0piQpQJ6qBX/CFba/KL7d5PRwqDFerMp7t3L71wvUDptx0e0pfckELJE= X-Received: by 2002:a05:6102:31ac:b0:357:530e:6496 with SMTP id d12-20020a05610231ac00b00357530e6496mr7418138vsh.38.1658045574610; Sun, 17 Jul 2022 01:12:54 -0700 (PDT) Received: from 480794996271 named unknown by gmailapi.google.com with HTTPREST; Sun, 17 Jul 2022 04:12:53 -0400 MIME-Version: 1.0 From: Simon Glass In-Reply-To: <20220707082245.v3.1.I04290e8071b92140ad565ea7397ce8604de743fe@changeid> References: <20220707082245.v3.1.I04290e8071b92140ad565ea7397ce8604de743fe@changeid> <20220707152353.1854462-1-dianders@chromium.org> Date: Sun, 17 Jul 2022 04:12:53 -0400 X-Google-Sender-Auth: blXeI5eKTkmWpAtTIZuid1xM67o Message-ID: Subject: Re: [PATCH v3 1/5] patman: Fix implicit command inserting To: Douglas Anderson Cc: amstan@chromium.org, mka@chromium.org, Sean Anderson , briannorris@chromium.org, u-boot@lists.denx.de, sjg@chromium.org Content-Type: text/plain; charset="UTF-8" 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.6 at phobos.denx.de X-Virus-Status: Clean The logic to insert an implicit command has always been a bit broken but it was masked by another bug fixed in the patch ("patman: Don't look at sys.argv when parsing settings"). Specifically, imagine that you're just calling patman like this: patman -c1 After the parse_known_args() command then the "-c1" will have been parsed and we'll have no command. The "rest" variable will be an empty list. Going into the logic you can see that nargs = 0. The implicit insertion of send ideally would create an argument list of: ['-c1', 'send'] ...but it doesn't because argv[:-0] is the same as argv[:0] and that's an empty list. Let's fix this little glitch. Signed-off-by: Douglas Anderson Tested-by: Brian Norris Reviewed-by: Brian Norris Reviewed-by: Simon Glass --- (no changes since v1) tools/patman/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Applied to u-boot-dm, thanks!