aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-02-26 12:10:10 +0100
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-03-20 11:03:06 +0100
commit8399488672e8717d3aa454f9f67408f96168074f (patch)
tree966d7e6c8f8287cd35a4afdaa43e8eca7e3ae6b6
parentff6af6eede200503c58250821d1285f94039eef7 (diff)
downloadu-boot-8399488672e8717d3aa454f9f67408f96168074f.zip
u-boot-8399488672e8717d3aa454f9f67408f96168074f.tar.gz
u-boot-8399488672e8717d3aa454f9f67408f96168074f.tar.bz2
efi_loader: export efi_dp_shorten()
Rename function shorten_path() to efi_dp_shorten() and export it. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
-rw-r--r--include/efi_loader.h3
-rw-r--r--lib/efi_loader/efi_device_path.c21
2 files changed, 15 insertions, 9 deletions
diff --git a/include/efi_loader.h b/include/efi_loader.h
index 110d8ae..1ffcdfc 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -725,7 +725,8 @@ extern void *efi_bounce_buffer;
#define EFI_LOADER_BOUNCE_BUFFER_SIZE (64 * 1024 * 1024)
#endif
-
+/* shorten device path */
+struct efi_device_path *efi_dp_shorten(struct efi_device_path *dp);
struct efi_device_path *efi_dp_next(const struct efi_device_path *dp);
int efi_dp_match(const struct efi_device_path *a,
const struct efi_device_path *b);
diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
index dc787b4..ddd5f13 100644
--- a/lib/efi_loader/efi_device_path.c
+++ b/lib/efi_loader/efi_device_path.c
@@ -122,20 +122,25 @@ int efi_dp_match(const struct efi_device_path *a,
}
}
-/*
+/**
+ * efi_dp_shorten() - shorten device-path
+ *
* We can have device paths that start with a USB WWID or a USB Class node,
* and a few other cases which don't encode the full device path with bus
* hierarchy:
*
- * - MESSAGING:USB_WWID
- * - MESSAGING:USB_CLASS
- * - MEDIA:FILE_PATH
- * - MEDIA:HARD_DRIVE
- * - MESSAGING:URI
+ * * MESSAGING:USB_WWID
+ * * MESSAGING:USB_CLASS
+ * * MEDIA:FILE_PATH
+ * * MEDIA:HARD_DRIVE
+ * * MESSAGING:URI
*
* See UEFI spec (section 3.1.2, about short-form device-paths)
+ *
+ * @dp: original devie-path
+ * @Return: shortened device-path or NULL
*/
-static struct efi_device_path *shorten_path(struct efi_device_path *dp)
+struct efi_device_path *efi_dp_shorten(struct efi_device_path *dp)
{
while (dp) {
/*
@@ -189,7 +194,7 @@ static struct efi_object *find_obj(struct efi_device_path *dp, bool short_path,
}
}
- obj_dp = shorten_path(efi_dp_next(obj_dp));
+ obj_dp = efi_dp_shorten(efi_dp_next(obj_dp));
} while (short_path && obj_dp);
}