lkml.org 
[lkml]   [2014]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86, efi: print debug values in Kib not MB


On 07/29/2014 04:29 PM, David Rientjes wrote:
> On Tue, 29 Jul 2014, Prarit Bhargava wrote:
>
>> diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
>> index 87fc96b..3875090 100644
>> --- a/arch/x86/platform/efi/efi.c
>> +++ b/arch/x86/platform/efi/efi.c
>> @@ -384,10 +384,10 @@ static void __init print_efi_memmap(void)
>> p < memmap.map_end;
>> p += memmap.desc_size, i++) {
>> md = p;
>> - pr_info("mem%02u: type=%u, attr=0x%llx, range=[0x%016llx-0x%016llx) (%lluMB)\n",
>> + pr_info("mem%02u: type=%u, attr=0x%llx, range=[0x%016llx-0x%016llx) (%lluKiB)\n",
>> i, md->type, md->attribute, md->phys_addr,
>> md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT),
>> - (md->num_pages >> (20 - EFI_PAGE_SHIFT)));
>> + (md->num_pages << 2));
>> }
>> #endif /* EFI_DEBUG */
>> }
>
> If EFI_PAGE_SHIFT were to ever change from its hard-coded 12, then this
> would be wrong. Any reason to not simply print EFI_PAGE_SIZE and
> md->num_pages?

Hmm ... maybe it might be better to print out (md->num_pages * EFI_PAGE_SIZE) >>
10 ? I'll just double check that in a kernel and repost.

Thanks for the suggestion David :)

P.
>


\
 
 \ /
  Last update: 2014-07-30 00:41    [W:0.196 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site