From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
op-tee@lists.trustedfirmware.org, linux-kernel@vger.kernel.org
Cc: Jens Wiklander <jens.wiklander@linaro.org>,
Sumit Garg <sumit.garg@linaro.org>
Subject: [PATCH v1 1/1] tee: amdtee: Use %pUl printk() format specifier to print GUIDs
Date: Wed, 11 Sep 2024 23:41:36 +0300 [thread overview]
Message-ID: <20240911204136.2887858-1-andriy.shevchenko@linux.intel.com> (raw)
Replace the custom approach with the %pUl printk() format specifier.
No functional change intended.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/tee/amdtee/core.c | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/drivers/tee/amdtee/core.c b/drivers/tee/amdtee/core.c
index e487231d25dc..d3201eff1b74 100644
--- a/drivers/tee/amdtee/core.c
+++ b/drivers/tee/amdtee/core.c
@@ -14,6 +14,7 @@
#include <linux/mm.h>
#include <linux/uaccess.h>
#include <linux/firmware.h>
+#include <linux/uuid.h>
#include "amdtee_private.h"
#include <linux/psp-tee.h>
@@ -172,21 +173,11 @@ static int copy_ta_binary(struct tee_context *ctx, void *ptr, void **ta,
{
const struct firmware *fw;
char fw_name[TA_PATH_MAX];
- struct {
- u32 lo;
- u16 mid;
- u16 hi_ver;
- u8 seq_n[8];
- } *uuid = ptr;
int n, rc = 0;
+ guid_t uuid;
- n = snprintf(fw_name, TA_PATH_MAX,
- "%s/%08x-%04x-%04x-%02x%02x%02x%02x%02x%02x%02x%02x.bin",
- TA_LOAD_PATH, uuid->lo, uuid->mid, uuid->hi_ver,
- uuid->seq_n[0], uuid->seq_n[1],
- uuid->seq_n[2], uuid->seq_n[3],
- uuid->seq_n[4], uuid->seq_n[5],
- uuid->seq_n[6], uuid->seq_n[7]);
+ import_guid(&uuid, ptr);
+ n = snprintf(fw_name, TA_PATH_MAX, "%s/%pUl.bin", TA_LOAD_PATH, &uuid);
if (n < 0 || n >= TA_PATH_MAX) {
pr_err("failed to get firmware name\n");
return -EINVAL;
--
2.43.0.rc1.1336.g36b5255a03ac
next reply other threads:[~2024-09-11 20:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-11 20:41 Andy Shevchenko [this message]
2024-09-12 5:50 ` [PATCH v1 1/1] tee: amdtee: Use %pUl printk() format specifier to print GUIDs Jens Wiklander
2024-09-13 9:29 ` Andy Shevchenko
2024-09-16 8:08 ` Rijo Thomas
2024-09-16 9:38 ` Andy Shevchenko
2024-09-16 9:39 ` Andy Shevchenko
2024-09-16 9:51 ` Andy Shevchenko
2024-09-17 7:22 ` Jerome Forissier
2024-09-18 9:54 ` Andy Shevchenko
2024-09-23 11:07 ` Rijo Thomas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240911204136.2887858-1-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=jens.wiklander@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=op-tee@lists.trustedfirmware.org \
--cc=sumit.garg@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox