Skip to contentSkip to conversation

partitions/ldm: Replace uuid_copy() with import_uuid() where it makes sense

PATCH Applied Andy Shevchenko 2 participants 3 messages Apr 22, 2020 – Jun 18, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 partitions/ldm: Replace uuid_copy() with import_uuid() where it makes sense

There is a specific API to treat raw data as UUID, i.e. import_uuid(). Use it instead of uuid_copy() with explicit casting.

---
 block/partitions/ldm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/partitions/ldm.c +1 -1
index 6fdfcb40c537b..d333786b5c7eb 100644
@@ -910,7 +910,7 @@ static bool ldm_parse_dsk4 (const u8 *buffer, int buflen, struct vblk *vb)
 		return false;
 
 	disk = &vb->vblk.disk;
-	uuid_copy(&disk->disk_id, (uuid_t *)(buffer + 0x18 + r_name));
+	import_uuid(&disk->disk_id, buffer + 0x18 + r_name);
 	return true;
 }
 
Signature · 1 line
2.26.1
#1 lore raw
Quoted 2 lines · Andy Shevchenko

There is a specific API to treat raw data as UUID, i.e. import_uuid(). Use it instead of uuid_copy() with explicit casting.

Any comment on this?

Quoted 21 lines
---
 block/partitions/ldm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
block/partitions/ldm.c +1 -1
index 6fdfcb40c537b..d333786b5c7eb 100644
@@ -910,7 +910,7 @@ static bool ldm_parse_dsk4 (const u8 *buffer, int buflen, struct vblk *vb)
 		return false;
 
 	disk = &vb->vblk.disk;
-	uuid_copy(&disk->disk_id, (uuid_t *)(buffer + 0x18 + r_name));
+	import_uuid(&disk->disk_id, buffer + 0x18 + r_name);
 	return true;
 }
 
Signature · 1 line
2.26.1
Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer Applied
#2 lore raw
In reply to Andy Shevchenko
Quoted 2 lines · Andy Shevchenko

There is a specific API to treat raw data as UUID, i.e. import_uuid(). Use it instead of uuid_copy() with explicit casting.

Applied, thanks.

Signature · 1 line
Jens Axboe