[PATCH v2 45/71] bootstd: Rename bootdev checkers

Simon Glass sjg at chromium.org
Sun Jan 8 03:50:21 CET 2023


These functions return 0 if the check passes, so the names are somewhat
confusing. Rename them.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

(no changes since v1)

 boot/bootflow.c         |  6 +++---
 boot/bootmeth_distro.c  |  2 +-
 boot/bootmeth_efi.c     |  2 +-
 boot/bootmeth_efi_mgr.c |  2 +-
 boot/bootmeth_pxe.c     |  2 +-
 boot/bootmeth_script.c  |  2 +-
 include/bootflow.h      | 12 ++++++------
 net/eth_bootdev.c       |  2 +-
 8 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/boot/bootflow.c b/boot/bootflow.c
index 163cd4953dd..0345755f58f 100644
--- a/boot/bootflow.c
+++ b/boot/bootflow.c
@@ -427,7 +427,7 @@ int bootflow_run_boot(struct bootflow_iter *iter, struct bootflow *bflow)
 	return ret;
 }
 
-int bootflow_iter_uses_blk_dev(const struct bootflow_iter *iter)
+int bootflow_iter_check_blk(const struct bootflow_iter *iter)
 {
 	const struct udevice *media = dev_get_parent(iter->dev);
 	enum uclass_id id = device_get_uclass_id(media);
@@ -439,7 +439,7 @@ int bootflow_iter_uses_blk_dev(const struct bootflow_iter *iter)
 	return -ENOTSUPP;
 }
 
-int bootflow_iter_uses_network(const struct bootflow_iter *iter)
+int bootflow_iter_check_net(const struct bootflow_iter *iter)
 {
 	const struct udevice *media = dev_get_parent(iter->dev);
 	enum uclass_id id = device_get_uclass_id(media);
@@ -451,7 +451,7 @@ int bootflow_iter_uses_network(const struct bootflow_iter *iter)
 	return -ENOTSUPP;
 }
 
-int bootflow_iter_uses_system(const struct bootflow_iter *iter)
+int bootflow_iter_check_system(const struct bootflow_iter *iter)
 {
 	const struct udevice *media = dev_get_parent(iter->dev);
 	enum uclass_id id = device_get_uclass_id(media);
diff --git a/boot/bootmeth_distro.c b/boot/bootmeth_distro.c
index 6ef0fa1f2c9..356929828b9 100644
--- a/boot/bootmeth_distro.c
+++ b/boot/bootmeth_distro.c
@@ -59,7 +59,7 @@ static int distro_check(struct udevice *dev, struct bootflow_iter *iter)
 	int ret;
 
 	/* This only works on block devices */
-	ret = bootflow_iter_uses_blk_dev(iter);
+	ret = bootflow_iter_check_blk(iter);
 	if (ret)
 		return log_msg_ret("blk", ret);
 
diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c
index d5438eb67b9..f7bb153d9de 100644
--- a/boot/bootmeth_efi.c
+++ b/boot/bootmeth_efi.c
@@ -104,7 +104,7 @@ static int distro_efi_check(struct udevice *dev, struct bootflow_iter *iter)
 	int ret;
 
 	/* This only works on block devices */
-	ret = bootflow_iter_uses_blk_dev(iter);
+	ret = bootflow_iter_check_blk(iter);
 	if (ret)
 		return log_msg_ret("blk", ret);
 
diff --git a/boot/bootmeth_efi_mgr.c b/boot/bootmeth_efi_mgr.c
index 2f327c1f8ce..e9d973429f7 100644
--- a/boot/bootmeth_efi_mgr.c
+++ b/boot/bootmeth_efi_mgr.c
@@ -36,7 +36,7 @@ static int efi_mgr_check(struct udevice *dev, struct bootflow_iter *iter)
 	int ret;
 
 	/* Must be an bootstd device */
-	ret = bootflow_iter_uses_system(iter);
+	ret = bootflow_iter_check_system(iter);
 	if (ret)
 		return log_msg_ret("net", ret);
 
diff --git a/boot/bootmeth_pxe.c b/boot/bootmeth_pxe.c
index e6992168c06..13e2ff486dc 100644
--- a/boot/bootmeth_pxe.c
+++ b/boot/bootmeth_pxe.c
@@ -44,7 +44,7 @@ static int distro_pxe_check(struct udevice *dev, struct bootflow_iter *iter)
 	int ret;
 
 	/* This only works on network devices */
-	ret = bootflow_iter_uses_network(iter);
+	ret = bootflow_iter_check_net(iter);
 	if (ret)
 		return log_msg_ret("net", ret);
 
diff --git a/boot/bootmeth_script.c b/boot/bootmeth_script.c
index a8f77e29f99..11dab91c18c 100644
--- a/boot/bootmeth_script.c
+++ b/boot/bootmeth_script.c
@@ -28,7 +28,7 @@ static int script_check(struct udevice *dev, struct bootflow_iter *iter)
 	int ret;
 
 	/* This only works on block devices */
-	ret = bootflow_iter_uses_blk_dev(iter);
+	ret = bootflow_iter_check_blk(iter);
 	if (ret)
 		return log_msg_ret("blk", ret);
 
diff --git a/include/bootflow.h b/include/bootflow.h
index 3a93e4b5cab..8ff9e332b1f 100644
--- a/include/bootflow.h
+++ b/include/bootflow.h
@@ -314,33 +314,33 @@ const char *bootflow_state_get_name(enum bootflow_state_t state);
 void bootflow_remove(struct bootflow *bflow);
 
 /**
- * bootflow_iter_uses_blk_dev() - Check that a bootflow uses a block device
+ * bootflow_iter_check_blk() - Check that a bootflow uses a block device
  *
  * This checks the bootdev in the bootflow to make sure it uses a block device
  *
  * Return: 0 if OK, -ENOTSUPP if some other device is used (e.g. ethernet)
  */
-int bootflow_iter_uses_blk_dev(const struct bootflow_iter *iter);
+int bootflow_iter_check_blk(const struct bootflow_iter *iter);
 
 /**
- * bootflow_iter_uses_network() - Check that a bootflow uses a network device
+ * bootflow_iter_check_net() - Check that a bootflow uses a network device
  *
  * This checks the bootdev in the bootflow to make sure it uses a network
  * device
  *
  * Return: 0 if OK, -ENOTSUPP if some other device is used (e.g. MMC)
  */
-int bootflow_iter_uses_network(const struct bootflow_iter *iter);
+int bootflow_iter_check_net(const struct bootflow_iter *iter);
 
 /**
- * bootflow_iter_uses_system() - Check that a bootflow uses the bootstd device
+ * bootflow_iter_check_system() - Check that a bootflow uses the bootstd device
  *
  * This checks the bootdev in the bootflow to make sure it uses the bootstd
  * device
  *
  * Return: 0 if OK, -ENOTSUPP if some other device is used (e.g. MMC)
  */
-int bootflow_iter_uses_system(const struct bootflow_iter *iter);
+int bootflow_iter_check_system(const struct bootflow_iter *iter);
 
 /**
  * bootflow_menu_new() - Create a new bootflow menu
diff --git a/net/eth_bootdev.c b/net/eth_bootdev.c
index fdf48f00131..bcbb35a74cd 100644
--- a/net/eth_bootdev.c
+++ b/net/eth_bootdev.c
@@ -27,7 +27,7 @@ static int eth_get_bootflow(struct udevice *dev, struct bootflow_iter *iter,
 	int ret;
 
 	/* Must be an Ethernet device */
-	ret = bootflow_iter_uses_network(iter);
+	ret = bootflow_iter_check_net(iter);
 	if (ret)
 		return log_msg_ret("net", ret);
 
-- 
2.39.0.314.g84b9a713c41-goog



More information about the U-Boot-Custodians mailing list