All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/1] efi_loader: remove duplicate function mem2hex()
@ 2019-01-18 17:54 Heinrich Schuchardt
  0 siblings, 0 replies; only message in thread
From: Heinrich Schuchardt @ 2019-01-18 17:54 UTC (permalink / raw)
  To: u-boot

Replace duplicate function mem2hex() by inline function bin2hex().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 lib/efi_loader/efi_variable.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c
index eea7f68b85..2ac27731fe 100644
--- a/lib/efi_loader/efi_variable.c
+++ b/lib/efi_loader/efi_variable.c
@@ -47,19 +47,6 @@
 
 #define PREFIX_LEN (strlen("efi_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx_"))
 
-static char *mem2hex(char *hexstr, const u8 *mem, int count)
-{
-	static const char hexchars[] = "0123456789abcdef";
-
-	while (count-- > 0) {
-		u8 ch = *mem++;
-		*hexstr++ = hexchars[ch >> 4];
-		*hexstr++ = hexchars[ch & 0xf];
-	}
-
-	return hexstr;
-}
-
 static efi_status_t efi_to_native(char **native, const u16 *variable_name,
 				  const efi_guid_t *vendor)
 {
@@ -282,7 +269,7 @@ efi_status_t EFIAPI efi_set_variable(u16 *variable_name,
 
 	/* store payload: */
 	s += sprintf(s, "(blob)");
-	s = mem2hex(s, data, data_size);
+	s = bin2hex(s, data, data_size);
 	*s = '\0';
 
 	debug("%s: setting: %s=%s\n", __func__, native_name, val);
-- 
2.20.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-01-18 17:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-18 17:54 [U-Boot] [PATCH 1/1] efi_loader: remove duplicate function mem2hex() Heinrich Schuchardt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.