[PATCH v2 18/35] bootstd: Tidy up var naming in bootdev_setup_iter_order()

Simon Glass sjg at chromium.org
Sat Jul 30 23:52:20 CEST 2022


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 <sjg at chromium.org>
---

(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



More information about the U-Boot mailing list