All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] fix setup_efi_pci()
@ 2013-01-18 12:35 Jan Beulich
       [not found] ` <50F94F9202000078000B74EE-ce6RLXgGx+vWGUEhTRrCg1aTQe2KTcn/@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Beulich @ 2013-01-18 12:35 UTC (permalink / raw)
  To: Matt Fleming, mjg-H+wXaHxf7aLQT0dZR+AlfA
  Cc: Bjorn Helgaas, linux-efi-u79uwXL29TY76Z2rM5mHXA

This fixes two issues:
- wrong memory type used for allocation intended to persist post-boot
- four similar build warnings on 32-bit (casts between different size
  pointers and integers)

Signed-off-by: Jan Beulich <jbeulich-IBi9RG/b67k@public.gmane.org>
---
v2: Drop the change that was already applied separately (commit
    886d751a2ea99a160f2d0a472231566d9cb0cf58 "x86, efi: correct
    precedence of operators in setup_efi_pci")

---
 arch/x86/boot/compressed/eboot.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- 3.8-rc4/arch/x86/boot/compressed/eboot.c
+++ 3.8-rc4-x86-EFI-PCI-ROMs/arch/x86/boot/compressed/eboot.c
@@ -256,10 +256,10 @@ static efi_status_t setup_efi_pci(struct
 	int i;
 	struct setup_data *data;
 
-	data = (struct setup_data *)params->hdr.setup_data;
+	data = (struct setup_data *)(unsigned long)params->hdr.setup_data;
 
 	while (data && data->next)
-		data = (struct setup_data *)data->next;
+		data = (struct setup_data *)(unsigned long)data->next;
 
 	status = efi_call_phys5(sys_table->boottime->locate_handle,
 				EFI_LOCATE_BY_PROTOCOL, &pci_proto,
@@ -311,7 +311,7 @@ static efi_status_t setup_efi_pci(struct
 		size = pci->romsize + sizeof(*rom);
 
 		status = efi_call_phys3(sys_table->boottime->allocate_pool,
-				EFI_LOADER_DATA, size, &rom);
+					EFI_RUNTIME_SERVICES_DATA, size, &rom);
 
 		if (status != EFI_SUCCESS)
 			continue;
@@ -345,9 +345,9 @@ static efi_status_t setup_efi_pci(struct
 		memcpy(rom->romdata, pci->romimage, pci->romsize);
 
 		if (data)
-			data->next = (uint64_t)rom;
+			data->next = (unsigned long)rom;
 		else
-			params->hdr.setup_data = (uint64_t)rom;
+			params->hdr.setup_data = (unsigned long)rom;
 
 		data = (struct setup_data *)rom;
 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-01-25 15:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-18 12:35 [PATCH v2] fix setup_efi_pci() Jan Beulich
     [not found] ` <50F94F9202000078000B74EE-ce6RLXgGx+vWGUEhTRrCg1aTQe2KTcn/@public.gmane.org>
2013-01-24 18:20   ` Matt Fleming
     [not found]     ` <1359051621.2496.95.camel-ZqTwcBeJ+wsBof6jY8KHXm7IUlhRatedral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2013-01-25  7:41       ` Jan Beulich
     [not found]         ` <5102452202000078000B9755-ce6RLXgGx+vWGUEhTRrCg1aTQe2KTcn/@public.gmane.org>
2013-01-25  8:45           ` Matt Fleming
     [not found]             ` <1359103537.2496.132.camel-ZqTwcBeJ+wsBof6jY8KHXm7IUlhRatedral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2013-01-25 11:04               ` Matt Fleming
2013-01-25 15:25               ` Matthew Garrett
2013-01-25 15:32               ` David Woodhouse

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.