fastboot: Replace literal 32 with PART_NAME_LEN
authorAlex Kiernan <alex.kiernan@gmail.com>
Tue, 9 Apr 2019 05:30:05 +0000 (05:30 +0000)
committerMarek Vasut <marex@denx.de>
Sun, 21 Apr 2019 08:26:52 +0000 (10:26 +0200)
Where we have to compute partition names, rather than using a hardcoded
32 for the partition name length, replace with PART_NAME_LEN.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Reviewed-by: Eugeniu Rosca <rosca.eugeniu@gmail.com>
drivers/fastboot/fb_mmc.c

index d04d8a448ccf036f847daa911c47f6857454cd5c..90ca81da9b5f338f09a27873fb142d142a07933e 100644 (file)
@@ -31,13 +31,13 @@ static int part_get_info_by_name_or_alias(struct blk_desc *dev_desc,
 
        ret = part_get_info_by_name(dev_desc, name, info);
        if (ret < 0) {
-               /* strlen("fastboot_partition_alias_") + 32(part_name) + 1 */
-               char env_alias_name[25 + 32 + 1];
+               /* strlen("fastboot_partition_alias_") + PART_NAME_LEN + 1 */
+               char env_alias_name[25 + PART_NAME_LEN + 1];
                char *aliased_part_name;
 
                /* check for alias */
                strcpy(env_alias_name, "fastboot_partition_alias_");
-               strncat(env_alias_name, name, 32);
+               strncat(env_alias_name, name, PART_NAME_LEN);
                aliased_part_name = env_get(env_alias_name);
                if (aliased_part_name != NULL)
                        ret = part_get_info_by_name(dev_desc,