From: "Jan Beulich" Subject: [PATCH] arm64/EFI: minor corrections Date: Mon, 12 Jan 2015 08:59:09 +0000 Message-ID: <54B39AED0200007800053846@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartCEFB24CD.2__=" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YAaqB-00065h-F9 for xen-devel@lists.xenproject.org; Mon, 12 Jan 2015 08:59:15 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Ian Campbell , roy.franz@linaro.org, Tim Deegan , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartCEFB24CD.2__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline - don't bail when using the last slot of bootinfo.mem.bank[] (due to premature incrementing of the array index) - GUIDs should be static const (and placed into .init.* whenever possible) - PrintErrMsg() issues a CR/LF pair itself - no need to explicitly append one to the message passed to the function Signed-off-by: Jan Beulich --- a/xen/arch/arm/efi/efi-boot.h +++ b/xen/arch/arm/efi/efi-boot.h @@ -104,7 +104,7 @@ static int __init fdt_set_reg(void *fdt, =20 static void __init *lookup_fdt_config_table(EFI_SYSTEM_TABLE *sys_table) { - const EFI_GUID fdt_guid =3D DEVICE_TREE_GUID; + static const EFI_GUID __initconst fdt_guid =3D DEVICE_TREE_GUID; EFI_CONFIGURATION_TABLE *tables; void *fdt =3D NULL; int i; @@ -135,15 +135,15 @@ static EFI_STATUS __init efi_process_mem || desc_ptr->Type =3D=3D EfiBootServicesCode || desc_ptr->Type =3D=3D EfiBootServicesData ) { - bootinfo.mem.bank[i].start =3D desc_ptr->PhysicalStart; - bootinfo.mem.bank[i].size =3D desc_ptr->NumberOfPages * = EFI_PAGE_SIZE; - if ( ++i >=3D NR_MEM_BANKS ) + if ( i >=3D NR_MEM_BANKS ) { - PrintStr(L"Warning: All "); - DisplayUint(NR_MEM_BANKS, -1); - PrintStr(L" bootinfo mem banks exhausted.\r\n"); + PrintStr(L"Warning: All " __stringify(NR_MEM_BANKS) + " bootinfo mem banks exhausted.\r\n"); break; } + bootinfo.mem.bank[i].start =3D desc_ptr->PhysicalStart; + bootinfo.mem.bank[i].size =3D desc_ptr->NumberOfPages * = EFI_PAGE_SIZE; + ++i; } desc_ptr =3D NextMemoryDescriptor(desc_ptr, desc_size); } @@ -334,7 +334,7 @@ static void __init efi_arch_process_memo status =3D fdt_add_uefi_nodes(SystemTable, fdt, map, map_size, = desc_size, desc_ver); if ( EFI_ERROR(status) ) - PrintErrMesg(L"Updating FDT failed\r\n", status); + PrintErrMesg(L"Updating FDT failed", status); } =20 static void __init efi_arch_pre_exit_boot(void) @@ -408,7 +408,7 @@ static void __init efi_arch_handle_cmdli =20 status =3D efi_bs->AllocatePool(EfiBootServicesData, EFI_PAGE_SIZE, = (void **)&buf); if ( EFI_ERROR(status) ) - PrintErrMesg(L"Unable to allocate string buffer\r\n", status); + PrintErrMesg(L"Unable to allocate string buffer", status); =20 if ( image_name ) { --=__PartCEFB24CD.2__= Content-Type: text/plain; name="arm64-EFI-cleanup.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="arm64-EFI-cleanup.patch" arm64/EFI: minor corrections=0A=0A- don't bail when using the last slot of = bootinfo.mem.bank[] (due to=0A premature incrementing of the array = index)=0A- GUIDs should be static const (and placed into .init.* = whenever=0A possible)=0A- PrintErrMsg() issues a CR/LF pair itself - no = need to explicitly=0A append one to the message passed to the function=0A= =0ASigned-off-by: Jan Beulich =0A=0A--- a/xen/arch/arm/e= fi/efi-boot.h=0A+++ b/xen/arch/arm/efi/efi-boot.h=0A@@ -104,7 +104,7 @@ = static int __init fdt_set_reg(void *fdt,=0A =0A static void __init = *lookup_fdt_config_table(EFI_SYSTEM_TABLE *sys_table)=0A {=0A- const = EFI_GUID fdt_guid =3D DEVICE_TREE_GUID;=0A+ static const EFI_GUID = __initconst fdt_guid =3D DEVICE_TREE_GUID;=0A EFI_CONFIGURATION_TABLE = *tables;=0A void *fdt =3D NULL;=0A int i;=0A@@ -135,15 +135,15 @@ = static EFI_STATUS __init efi_process_mem=0A || desc_ptr->Type = =3D=3D EfiBootServicesCode=0A || desc_ptr->Type =3D=3D = EfiBootServicesData )=0A {=0A- bootinfo.mem.bank[i].star= t =3D desc_ptr->PhysicalStart;=0A- bootinfo.mem.bank[i].size = =3D desc_ptr->NumberOfPages * EFI_PAGE_SIZE;=0A- if ( ++i >=3D = NR_MEM_BANKS )=0A+ if ( i >=3D NR_MEM_BANKS )=0A = {=0A- PrintStr(L"Warning: All ");=0A- = DisplayUint(NR_MEM_BANKS, -1);=0A- PrintStr(L" bootinfo mem = banks exhausted.\r\n");=0A+ PrintStr(L"Warning: All " = __stringify(NR_MEM_BANKS)=0A+ " bootinfo mem = banks exhausted.\r\n");=0A break;=0A }=0A+ = bootinfo.mem.bank[i].start =3D desc_ptr->PhysicalStart;=0A+ = bootinfo.mem.bank[i].size =3D desc_ptr->NumberOfPages * EFI_PAGE_SIZE;= =0A+ ++i;=0A }=0A desc_ptr =3D NextMemoryDescrip= tor(desc_ptr, desc_size);=0A }=0A@@ -334,7 +334,7 @@ static void = __init efi_arch_process_memo=0A status =3D fdt_add_uefi_nodes(SystemTab= le, fdt, map, map_size, desc_size,=0A = desc_ver);=0A if ( EFI_ERROR(status) )=0A- PrintErrMesg(L"Updati= ng FDT failed\r\n", status);=0A+ PrintErrMesg(L"Updating FDT = failed", status);=0A }=0A =0A static void __init efi_arch_pre_exit_boot(voi= d)=0A@@ -408,7 +408,7 @@ static void __init efi_arch_handle_cmdli=0A =0A = status =3D efi_bs->AllocatePool(EfiBootServicesData, EFI_PAGE_SIZE, = (void **)&buf);=0A if ( EFI_ERROR(status) )=0A- PrintErrMesg(L"U= nable to allocate string buffer\r\n", status);=0A+ PrintErrMesg(L"Un= able to allocate string buffer", status);=0A =0A if ( image_name )=0A = {=0A --=__PartCEFB24CD.2__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__PartCEFB24CD.2__=--