[PATCH 1/3] disk: efi: Move logic to get a GPT entry into a helper function
Javier Martinez Canillas
javierm at redhat.com
Mon Jun 16 16:08:38 CEST 2025
Heinrich Schuchardt <xypron.glpk at gmx.de> writes:
Thanks Ilias and Heinrich for your review / feedback.
> On 16.06.25 15:32, Ilias Apalodimas wrote:
>> On Fri, 13 Jun 2025 at 11:58, Javier Martinez Canillas
>> <javierm at redhat.com> wrote:
>>>
>>> Factor out the logic to get the Partition Table Entry (PTE) of a given
>>> partition into a helper function, since it could be used by other code.
>>>
>>> Signed-off-by: Javier Martinez Canillas <javierm at redhat.com>
>>> ---
>>>
>>> disk/part_efi.c | 67 +++++++++++++++++++++++++++++--------------------
>>> 1 file changed, 40 insertions(+), 27 deletions(-)
>>>
>>> diff --git a/disk/part_efi.c b/disk/part_efi.c
>>> index 932d058c184c..c7d79e253958 100644
>>> --- a/disk/part_efi.c
>>> +++ b/disk/part_efi.c
>>> @@ -216,6 +216,34 @@ int get_disk_guid(struct blk_desc *desc, char *guid)
>>> return 0;
>>> }
>>>
>>> +static int part_get_gpt_pte(struct blk_desc *desc, int part, gpt_entry *gpt_e)
>>> +{
>>> + ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1, desc->blksz);
>>> + gpt_entry *gpt_pte = NULL;
>>> +
>>> + /* "part" argument must be at least 1 */
>>> + if (part < 1) {
>>> + log_debug("Invalid Argument(s)\n");
>>
>> I think this should be a log_err an match the comment above
>
> Screen output during a running EFI application like GRUB should be
> avoided as output will no longer match the expected cursor positioning
> for the EFI console.
>
> Please, stick to log_debug().
>
I agree. This allows to have for example flicker-free boot output. But
also, I tried to follow the convention I noticed in this file and AFAICT
most messages printouts were using just log_debug().
> Shell commands like gpt should write a message based on error codes.
>
> Best regards
>
> Heinrich
>
--
Best regards,
Javier Martinez Canillas
Core Platforms
Red Hat
More information about the U-Boot
mailing list