[PATCH 01/25] efi-devicepath: Make efi_device_path argument const

Sascha Hauer s.hauer at pengutronix.de
Mon Dec 13 13:08:41 PST 2021


unpack_device_path() must not modify the efi_device_path * argument, so
make that sure by making it const.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 common/efi-devicepath.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/common/efi-devicepath.c b/common/efi-devicepath.c
index f17b9294cc..92c3ac8cee 100644
--- a/common/efi-devicepath.c
+++ b/common/efi-devicepath.c
@@ -468,9 +468,10 @@ device_path_from_handle(efi_handle_t Handle)
 }
 
 static struct efi_device_path *
-unpack_device_path(struct efi_device_path *dev_path)
+unpack_device_path(const struct efi_device_path *dev_path)
 {
-	struct efi_device_path *Src, *Dest, *new_path;
+	const struct efi_device_path *Src;
+	struct efi_device_path *Dest, *new_path;
 	unsigned long Size;
 
 	/* Walk device path and round sizes to valid boundaries */
-- 
2.30.2




More information about the barebox mailing list