mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: sha@pengutronix.de, Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH master 2/2] commands: stat: fix UUID print
Date: Tue, 14 Mar 2023 09:58:05 +0100	[thread overview]
Message-ID: <20230314085805.1860986-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20230314085805.1860986-1-a.fatoum@pengutronix.de>

cdev->uuid is an already formatted string, not a binary UUID.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 fs/fs.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/fs/fs.c b/fs/fs.c
index 4837c4b701bc..65e4c661b9ce 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -69,8 +69,6 @@ EXPORT_SYMBOL(mkmodestr);
 
 void cdev_print(const struct cdev *cdev)
 {
-	bool uuid_set;
-
 	if (cdev->dev || cdev->master || cdev->partname) {
 		printf("Origin: %s", dev_name(cdev->dev) ?: "None");
 		if (cdev->master)
@@ -98,14 +96,13 @@ void cdev_print(const struct cdev *cdev)
 	}
 	printf("\n");
 
-	uuid_set = memchr_inv(cdev->uuid, 0x00 ,sizeof(cdev->uuid));
-	if (cdev->filetype || cdev->dos_partition_type || uuid_set) {
+	if (cdev->filetype || cdev->dos_partition_type || *cdev->uuid) {
 		if (cdev->filetype)
 			printf("Filetype: %s\t", file_type_to_string(cdev->filetype));
 		if (cdev->dos_partition_type)
 			printf("DOS parttype: 0x%02x\t", cdev->dos_partition_type);
-		if (uuid_set)
-			printf("UUID: %pUl", cdev->uuid);
+		if (*cdev->uuid)
+			printf("UUID: %s", cdev->uuid);
 		printf("\n");
 	}
 }
-- 
2.30.2





  reply	other threads:[~2023-03-14 13:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-14  8:58 [PATCH master 1/2] of: partition: skip NVMEM partition setup partition parsing fails Ahmad Fatoum
2023-03-14  8:58 ` Ahmad Fatoum [this message]
2023-03-14  9:02 ` Sascha Hauer

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=20230314085805.1860986-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=sha@pengutronix.de \
    /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