[U-Boot] [PATCH] cmd: part: number: return hexadecimal value

Igor Opaniuk igor.opaniuk at gmail.com
Tue Sep 24 06:24:57 UTC 2019


On Fri, Sep 20, 2019 at 4:59 PM Eugeniu Rosca <erosca at de.adit-jv.com> wrote:
>
> From: Roman Stratiienko <roman.stratiienko at globallogic.com>
>
> At this point we are using part number sub-command to retrieve UUID
> of the partition using it's name.
>
> e.g.:
>  part number mmc $mmcdev system_a system_a_index
>  part uuid mmc $mmcdev:${system_a_index} system_a_uuid
>
> Since 'part uuid' sub-command expects partition index in hex format and
> 'part number' returns decimal value, 'part uuid' command will provide
> wrong UUID or fail.
>
> Fixes: be683756f62034 ("cmd: part: Add 'number' sub-command")
> Cc: Dirk Behme <dirk.behme at de.bosch.com>
> Reported-by: Pontus Fuchs <pontus.fuchs at se.bosch.com>
> Signed-off-by: Roman Stratiienko <roman.stratiienko at globallogic.com>
> Signed-off-by: Eugeniu Rosca <erosca at de.adit-jv.com>
> ---
>  cmd/part.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/cmd/part.c b/cmd/part.c
> index 6cfb67b27959..5e4e45ca6d8b 100644
> --- a/cmd/part.c
> +++ b/cmd/part.c
> @@ -152,7 +152,7 @@ static int do_part_info(int argc, char * const argv[], enum cmd_part_info param)
>                 snprintf(buf, sizeof(buf), LBAF, info.size);
>                 break;
>         case CMD_PART_INFO_NUMBER:
> -               snprintf(buf, sizeof(buf), "%d", part);
> +               snprintf(buf, sizeof(buf), "0x%x", part);
>                 break;
>         default:
>                 printf("** Unknown cmd_part_info value: %d\n", param);
> --
> 2.23.0
>

Reviewed-by: Igor Opaniuk <igor.opaniuk at gmail.com>

-- 
Best regards - Freundliche GrĂ¼sse - Meilleures salutations

Igor Opaniuk

mailto: igor.opaniuk at gmail.com
skype: igor.opanyuk
+380 (93) 836 40 67
http://ua.linkedin.com/in/iopaniuk


More information about the U-Boot mailing list