]> git.sur5r.net Git - u-boot/blobdiff - cmd/gpt.c
SPDX: Convert all of our single license tags to Linux Kernel style
[u-boot] / cmd / gpt.c
index 9e04affc069429d716b8506b769c66a149af2cf0..638870352f406d11f5738f6739a2d6731c26468b 100644 (file)
--- a/cmd/gpt.c
+++ b/cmd/gpt.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * cmd_gpt.c -- GPT (GUID Partition Table) handling command
  *
@@ -7,8 +8,6 @@
  * Copyright (C) 2012 Samsung Electronics
  * author: Lukasz Majewski <l.majewski@samsung.com>
  * author: Piotr Wilczek <p.wilczek@samsung.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -282,14 +281,14 @@ static int create_gpt_partitions_list(int numparts, const char *guid,
                strcat(partitions_list, "name=");
                strncat(partitions_list, (const char *)curr->gpt_part_info.name,
                        PART_NAME_LEN + 1);
-               strcat(partitions_list, ",start=");
-               prettyprint_part_size(partstr, (unsigned long)curr->gpt_part_info.start,
-                                     (unsigned long) curr->gpt_part_info.blksz);
+               sprintf(partstr, ",start=0x%llx",
+                       (unsigned long long)curr->gpt_part_info.start *
+                                           curr->gpt_part_info.blksz);
                /* one extra byte for NULL */
                strncat(partitions_list, partstr, PART_NAME_LEN + 1);
-               strcat(partitions_list, ",size=");
-               prettyprint_part_size(partstr, curr->gpt_part_info.size,
-                                     curr->gpt_part_info.blksz);
+               sprintf(partstr, ",size=0x%llx",
+                       (unsigned long long)curr->gpt_part_info.size *
+                                           curr->gpt_part_info.blksz);
                strncat(partitions_list, partstr, PART_NAME_LEN + 1);
 
                strcat(partitions_list, ",uuid=");
@@ -402,7 +401,7 @@ static int set_gpt_info(struct blk_desc *dev_desc,
        if (!val) {
 #ifdef CONFIG_RANDOM_UUID
                *str_disk_guid = malloc(UUID_STR_LEN + 1);
-               if (str_disk_guid == NULL)
+               if (*str_disk_guid == NULL)
                        return -ENOMEM;
                gen_rand_uuid_str(*str_disk_guid, UUID_STR_FORMAT_STD);
 #else