Skip to content

x86/boot/compressed: Enable -Wunused and remove unused variables

Thorsten Blum lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 1 replyIn review
  2. v14 patches 0 repliesSuperseded

Changes in v2 from the cover letter

- Fix a kernel test robot issue by marking __efi_get_rsdp_addr() as __maybe_unused: https://lore.kernel.org/r/[email protected]/
- v1: https://lore.kernel.org/r/[email protected]/

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4x86/boot/compressed: Remove unused variables in EFI helpersarch/x86/boot/compressed/efi.c+5 -120 replies
2/4x86/boot/compressed: Clean up EFI RSDP lookup in efi_get_rsdp_addr()arch/x86/boot/compressed/acpi.c+4 -140 replies
3/4x86/boot/compressed: Mark process_mem_region() index __maybe_unusedarch/x86/boot/compressed/kaslr.c+2 -10 replies
4/4x86/boot/compressed: Enable -Wunusedarch/x86/boot/compressed/Makefile+3 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/4] x86/boot/compressed: Enable -Wunused and remove unused variables

This series marks potentially unused variables and functions as __maybe_unused and removes truly unused ones. Patch 4 enables -Wunused, matching the W=0 kernel defaults. With WERROR=y, the warnings failed as follows:

arch/x86/boot/compressed/acpi.c:25:1: error: ‘__efi_get_rsdp_addr’ defined but not used arch/x86/boot/compressed/acpi.c:29:6: error: unused variable 'ret' arch/x86/boot/compressed/acpi.c:57:15: error: unused variable 'nr_tables' arch/x86/boot/compressed/efi.c:64:16: error: unused variable 'et' arch/x86/boot/compressed/efi.c:136:6: error: unused variable 'ret' arch/x86/boot/compressed/kaslr.c:600:13: error: unused variable ‘i’

Patch 2 also drops a redundant efi_get_system_table() call and uses the existing efi_get_conf_table() error path.

Changes in v2:
- Fix a kernel test robot issue by marking __efi_get_rsdp_addr() as __maybe_unused: https://lore.kernel.org/r/[email protected]/
- v1: https://lore.kernel.org/r/[email protected]/

Thorsten Blum (4):
x86/boot/compressed: Remove unused variables in EFI helpers x86/boot/compressed: Clean up EFI RSDP lookup in efi_get_rsdp_addr() x86/boot/compressed: Mark process_mem_region() index __maybe_unused x86/boot/compressed: Enable -Wunused

 arch/x86/boot/compressed/Makefile |  3 +++
 arch/x86/boot/compressed/acpi.c   | 18 ++++--------------
 arch/x86/boot/compressed/efi.c    | 17 +++++------------
 arch/x86/boot/compressed/kaslr.c  |  3 ++-
 4 files changed, 14 insertions(+), 27 deletions(-)

base-commit: 840ef6c78e6a2f694b578ecb9063241c992aaa9e