[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 6/7] commands/probe: use grub_gpt_part_guid_snprint
From: |
Daniel Kiper |
Subject: |
Re: [PATCH v2 6/7] commands/probe: use grub_gpt_part_guid_snprint |
Date: |
Tue, 28 Feb 2023 18:22:24 +0100 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Mon, Feb 20, 2023 at 07:56:29PM +0100, Oliver Steffen wrote:
> Use the new function for printing the partition guid.
>
> Signed-off-by: Oliver Steffen <osteffen@redhat.com>
This and next patch LGTM...
> ---
> grub-core/commands/probe.c | 11 ++---------
> 1 file changed, 2 insertions(+), 9 deletions(-)
>
> diff --git a/grub-core/commands/probe.c b/grub-core/commands/probe.c
> index 9a80ea54f..3fe50d11e 100644
> --- a/grub-core/commands/probe.c
> +++ b/grub-core/commands/probe.c
> @@ -104,7 +104,7 @@ grub_cmd_probe (grub_extcmd_context_t ctxt, int argc,
> char **args)
> if (state[6].set)
> {
> /* AAAABBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF + null terminator */
> - char val[37] = "none";
> + char val[GRUB_GPT_GUID_STR_LEN + 1] = "none";
Good! You are doing what I asked for in the reply earlier... :-)
> if (dev->disk && dev->disk->partition)
> {
> struct grub_partition *p = dev->disk->partition;
> @@ -130,14 +130,7 @@ grub_cmd_probe (grub_extcmd_context_t ctxt, int argc,
> char **args)
> return grub_errno;
> }
> guid = &entry.guid;
> - grub_snprintf (val, sizeof(val),
> - "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
> - grub_le_to_cpu32 (guid->data1),
> - grub_le_to_cpu16 (guid->data2),
> - grub_le_to_cpu16 (guid->data3),
> - guid->data4[0], guid->data4[1], guid->data4[2],
> - guid->data4[3], guid->data4[4], guid->data4[5],
> - guid->data4[6], guid->data4[7]);
> + grub_gpt_part_guid_snprint (val, sizeof(val), guid);
Daniel
- Re: [PATCH v2 3/7] Add a module for the Boot Loader Interface, (continued)
- [PATCH v2 1/7] efi: add grub_efi_set_variable_with_attributes, Oliver Steffen, 2023/02/20
- [PATCH v2 4/7] util/grub.d: activate bli module on EFI, Oliver Steffen, 2023/02/20
- [PATCH v2 2/7] efi: check for integer overflow in string conversion, Oliver Steffen, 2023/02/20
- [PATCH v2 7/7] commands/bli: use grub_gpt_part_guid_snprint, Oliver Steffen, 2023/02/20
- [PATCH v2 6/7] commands/probe: use grub_gpt_part_guid_snprint, Oliver Steffen, 2023/02/20
- Re: [PATCH v2 6/7] commands/probe: use grub_gpt_part_guid_snprint,
Daniel Kiper <=
- [PATCH v2 5/7] partmap/gpt: add print function for guids, Oliver Steffen, 2023/02/20