Skip to contentSkip to conversation

efi/libstub: x86: fix unused-variable warning

PATCH In review Arnd Bergmann 2 participants 2 messages Jan 8, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi/libstub: x86: fix unused-variable warning

The only users of these got removed, so they also need to be removed to avoid warnings:

arch/x86/boot/compressed/eboot.c: In function 'setup_efi_pci':
arch/x86/boot/compressed/eboot.c:117:16: error: unused variable 'nr_pci' [-Werror=unused-variable]

  unsigned long nr_pci;
                ^~~~~~
arch/x86/boot/compressed/eboot.c: In function 'setup_uga':
arch/x86/boot/compressed/eboot.c:244:16: error: unused variable 'nr_ugas' [-Werror=unused-variable]
  unsigned long nr_ugas;
                ^~~~~~~
Fixes 2732ea0d5c0a ("efi/libstub: Use a helper to iterate over a EFI handle array")
---
 arch/x86/boot/compressed/eboot.c | 2 --
 1 file changed, 2 deletions(-)
arch/x86/boot/compressed/eboot.c +0 -2
index da04948d75ed..57dfdc53d714 100644
@@ -114,7 +114,6 @@ static void setup_efi_pci(struct boot_params *params)
 	void **pci_handle = NULL;
 	efi_guid_t pci_proto = EFI_PCI_IO_PROTOCOL_GUID;
 	unsigned long size = 0;
-	unsigned long nr_pci;
 	struct setup_data *data;
 	efi_handle_t h;
 	int i;
@@ -241,7 +240,6 @@ setup_uga(struct screen_info *si, efi_guid_t *uga_proto, unsigned long size)
 	u32 width, height;
 	void **uga_handle = NULL;
 	efi_uga_draw_protocol_t *uga = NULL, *first_uga;
-	unsigned long nr_ugas;
 	efi_handle_t handle;
 	int i;
 
Signature · 1 line
2.20.0
Acked-by on v1 1/1
#1 lore raw
Quoted 13 lines · Arnd Bergmann

The only users of these got removed, so they also need to be removed to avoid warnings:

arch/x86/boot/compressed/eboot.c: In function 'setup_efi_pci':
arch/x86/boot/compressed/eboot.c:117:16: error: unused variable 'nr_pci' [-Werror=unused-variable]

  unsigned long nr_pci;
                ^~~~~~
arch/x86/boot/compressed/eboot.c: In function 'setup_uga':
arch/x86/boot/compressed/eboot.c:244:16: error: unused variable 'nr_ugas' [-Werror=unused-variable]
  unsigned long nr_ugas;
                ^~~~~~~
Quoted 2 lines
Fixes 2732ea0d5c0a ("efi/libstub: Use a helper to iterate over a EFI handle array")

Oops

or I can add it to my next batch of EFI changes at the end of the week.

Quoted 27 lines
---
 arch/x86/boot/compressed/eboot.c | 2 --
 1 file changed, 2 deletions(-)
arch/x86/boot/compressed/eboot.c +0 -3
index da04948d75ed..57dfdc53d714 100644
@@ -114,7 +114,6 @@ static void setup_efi_pci(struct boot_params *params)
        void **pci_handle = NULL;
        efi_guid_t pci_proto = EFI_PCI_IO_PROTOCOL_GUID;
        unsigned long size = 0;
-       unsigned long nr_pci;
        struct setup_data *data;
        efi_handle_t h;
        int i;
@@ -241,7 +240,6 @@ setup_uga(struct screen_info *si, efi_guid_t *uga_proto, unsigned long size)
        u32 width, height;
        void **uga_handle = NULL;
        efi_uga_draw_protocol_t *uga = NULL, *first_uga;
-       unsigned long nr_ugas;
        efi_handle_t handle;
        int i;
 
--

2.20.0