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 A84E7C19F28 for ; Sat, 30 Jul 2022 21:57:00 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DC9E18452F; Sat, 30 Jul 2022 23:53:59 +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=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="kMou+5eE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 93CCE8412C; Sat, 30 Jul 2022 23:53:41 +0200 (CEST) Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) (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 42737844B9 for ; Sat, 30 Jul 2022 23:53:38 +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@chromium.org Received: by mail-oi1-x22a.google.com with SMTP id u9so9244140oiv.12 for ; Sat, 30 Jul 2022 14:53:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=dZj/5m0N46AUIhGVYdwdy/sDqUrrZdCkiM4/I5tmA1c=; b=kMou+5eEa71w7VHpXCAx7BQlXlZKxM4Cw9kxSKex+yWvRRei4zNChCfLXkoH3zy2zk lclxwitX8/D0SZxQbPCKQS0fUSuIJu067vtS3X83JoXOYALdNSqX8li/w0/GK2wE7MuX 9jE5qIbDeGKJkbkLkiG5leScyELNry1r7Pqdg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=dZj/5m0N46AUIhGVYdwdy/sDqUrrZdCkiM4/I5tmA1c=; b=MPjF2oCttbXq5T/vB9CYg8JzyXetHQ+txzqX371rplDkUDyr1J6FnL4pdI55G3UgVv LdlEGTtn4wtpOqip+hgN+c0l7w3NuxKQ60xiNKVunUii9eTzJqJnCpRrOifKcq3aTcg2 FzGhnp3XJ4J7FVnJHP3gAzGuQHkrWdQp7hK6uOq2zf94Rgde2mqsOGkcM+5D30LneEKA FlGMZmvRJc2SpEC9Chl1DZc4u7Hxo4LinL3KW4HprUAKr/BsZ8d2JBKwx6Ib0pouHMIk YrBee7kxHc/DjjwmlqSFRF7bM77LLxKo1idHNn4QWXTLiZHiER7/NuoP0ct6xu3S+ylt /i6g== X-Gm-Message-State: AJIora8T9qNVfCoGRmuuei2v9neDD2qLiXcy7o12YPQCTqANBPk+E4kN MrxkpP3a4ahi4yN8VQQHqjIVzKFGgDF2AJg0 X-Google-Smtp-Source: AGRyM1sVD5j8arRabZCaQuqp3y95OpGHg/CdgbikGmf+TLTpCWyGZEAo7AqTn94GlWMHszE5fiMKIA== X-Received: by 2002:a54:4788:0:b0:33a:6311:a734 with SMTP id o8-20020a544788000000b0033a6311a734mr4443388oic.156.1659218003254; Sat, 30 Jul 2022 14:53:23 -0700 (PDT) Received: from sjg1.lan (c-67-190-102-125.hsd1.co.comcast.net. [67.190.102.125]) by smtp.gmail.com with ESMTPSA id 19-20020a544193000000b0032f75714af1sm1699656oiy.18.2022.07.30.14.53.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Jul 2022 14:53:22 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Bin Meng , Simon Glass Subject: [PATCH v2 18/35] bootstd: Tidy up var naming in bootdev_setup_iter_order() Date: Sat, 30 Jul 2022 15:52:20 -0600 Message-Id: <20220730215237.818368-14-sjg@chromium.org> X-Mailer: git-send-email 2.37.1.455.g008518b4e5-goog In-Reply-To: <20220730215237.818368-1-sjg@chromium.org> References: <20220730215237.818368-1-sjg@chromium.org> MIME-Version: 1.0 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.6 at phobos.denx.de X-Virus-Status: Clean Avoid using 'count' to mean either a count or an error, since this is confusing. In fact, the called function never return 0, since that is an error. Use 'ret' instead. Signed-off-by: Simon Glass --- (no changes since v1) boot/bootdev-uclass.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/boot/bootdev-uclass.c b/boot/bootdev-uclass.c index 1ede933c2f2..5683006c73c 100644 --- a/boot/bootdev-uclass.c +++ b/boot/bootdev-uclass.c @@ -604,14 +604,14 @@ int bootdev_setup_iter_order(struct bootflow_iter *iter, struct udevice **devp) log_debug("Expected %d bootdevs, found %d using aliases\n", count, upto); - count = build_order(bootstd, order, upto); - if (count < 0) { + ret = build_order(bootstd, order, upto); + if (ret < 0) { free(order); - return log_msg_ret("build", count); + return log_msg_ret("build", ret); } + iter->num_devs = ret; iter->dev_order = order; - iter->num_devs = count; iter->cur_dev = 0; dev = *order; -- 2.37.1.455.g008518b4e5-goog