Skip to contentSkip to conversation

fdisk: gpt: use swap_efi_guid for new partitions

PATCH Applied Davidlohr Bueso 2 participants 2 messages Oct 7, 2012 – Oct 18, 2012 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 5/5 fdisk: gpt: use swap_efi_guid for new partitions

---
 fdisks/gpt.c |   12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
fdisks/gpt.c +1 -11
index 467b944..5b792a6 100644
@@ -1430,17 +1430,7 @@ static int gpt_create_new_partition(int partnum, uint64_t fsect, uint64_t lsect,
 	 * to have a unique GUID.
 	 */
 	uuid_generate_random((unsigned char *) &e->unique_partition_guid);
-
-	/*
-	 * UUID is traditionally 16 byte big-endian array, except Intel EFI
-	 * specs where the UUID is a structure of little-endian fields, convert.
-	 */
-	e->unique_partition_guid.time_low =
-		cpu_to_le32(e->unique_partition_guid.time_low);
-	e->unique_partition_guid.time_mid =
-		cpu_to_le16(e->unique_partition_guid.time_mid);
-	e->unique_partition_guid.time_hi_and_version =
-		cpu_to_le16(e->unique_partition_guid.time_hi_and_version);
+	swap_efi_guid(&e->unique_partition_guid);
 
 	memcpy(&entries[partnum] , e, sizeof(*e));
 
Signature · 1 line
1.7.9.5
maintainer Applied
#1 lore raw
Quoted 2 lines · Davidlohr Bueso
 fdisks/gpt.c |   12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

Applied, thanks.

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com