Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

efi/libstub: Tidy up types and names of global cmdline variables

Drop leading underscores and use bool not int for true/false
variables set on the command line.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Cc: Arvind Sankar <nivedita@alum.mit.edu>
Cc: Borislav Petkov <bp@alien8.de>
Cc: James Morse <james.morse@arm.com>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Link: https://lkml.kernel.org/r/20191224151025.32482-25-ardb@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Ard Biesheuvel and committed by
Ingo Molnar
7d4e323d 966291f6

+28 -22
+1 -1
drivers/firmware/efi/libstub/arm-stub.c
··· 37 37 38 38 static u64 virtmap_base = EFI_RT_VIRTUAL_BASE; 39 39 40 - static efi_system_table_t *__section(.data) sys_table; 40 + static efi_system_table_t *__efistub_global sys_table; 41 41 42 42 __pure efi_system_table_t *efi_system_table(void) 43 43 {
+18 -18
drivers/firmware/efi/libstub/efi-stub-helper.c
··· 27 27 */ 28 28 #define EFI_READ_CHUNK_SIZE (1024 * 1024) 29 29 30 - static unsigned long __chunk_size = EFI_READ_CHUNK_SIZE; 30 + static unsigned long efi_chunk_size = EFI_READ_CHUNK_SIZE; 31 31 32 - static int __section(.data) __nokaslr; 33 - static int __section(.data) __quiet; 34 - static int __section(.data) __novamap; 35 - static bool __section(.data) efi_nosoftreserve; 32 + static bool __efistub_global efi_nokaslr; 33 + static bool __efistub_global efi_quiet; 34 + static bool __efistub_global efi_novamap; 35 + static bool __efistub_global efi_nosoftreserve; 36 36 37 - int __pure nokaslr(void) 37 + bool __pure nokaslr(void) 38 38 { 39 - return __nokaslr; 39 + return efi_nokaslr; 40 40 } 41 - int __pure is_quiet(void) 41 + bool __pure is_quiet(void) 42 42 { 43 - return __quiet; 43 + return efi_quiet; 44 44 } 45 - int __pure novamap(void) 45 + bool __pure novamap(void) 46 46 { 47 - return __novamap; 47 + return efi_novamap; 48 48 } 49 49 bool __pure __efi_soft_reserve_enabled(void) 50 50 { ··· 455 455 456 456 str = strstr(cmdline, "nokaslr"); 457 457 if (str == cmdline || (str && str > cmdline && *(str - 1) == ' ')) 458 - __nokaslr = 1; 458 + efi_nokaslr = true; 459 459 460 460 str = strstr(cmdline, "quiet"); 461 461 if (str == cmdline || (str && str > cmdline && *(str - 1) == ' ')) 462 - __quiet = 1; 462 + efi_quiet = true; 463 463 464 464 /* 465 465 * If no EFI parameters were specified on the cmdline we've got ··· 479 479 while (*str && *str != ' ') { 480 480 if (!strncmp(str, "nochunk", 7)) { 481 481 str += strlen("nochunk"); 482 - __chunk_size = -1UL; 482 + efi_chunk_size = -1UL; 483 483 } 484 484 485 485 if (!strncmp(str, "novamap", 7)) { 486 486 str += strlen("novamap"); 487 - __novamap = 1; 487 + efi_novamap = true; 488 488 } 489 489 490 490 if (IS_ENABLED(CONFIG_EFI_SOFT_RESERVE) && 491 491 !strncmp(str, "nosoftreserve", 7)) { 492 492 str += strlen("nosoftreserve"); 493 - efi_nosoftreserve = 1; 493 + efi_nosoftreserve = true; 494 494 } 495 495 496 496 /* Group words together, delimited by "," */ ··· 644 644 while (size) { 645 645 unsigned long chunksize; 646 646 647 - if (IS_ENABLED(CONFIG_X86) && size > __chunk_size) 648 - chunksize = __chunk_size; 647 + if (IS_ENABLED(CONFIG_X86) && size > efi_chunk_size) 648 + chunksize = efi_chunk_size; 649 649 else 650 650 chunksize = size; 651 651
+9 -3
drivers/firmware/efi/libstub/efistub.h
··· 25 25 #define EFI_ALLOC_ALIGN EFI_PAGE_SIZE 26 26 #endif 27 27 28 - extern int __pure nokaslr(void); 29 - extern int __pure is_quiet(void); 30 - extern int __pure novamap(void); 28 + #ifdef CONFIG_ARM 29 + #define __efistub_global __section(.data) 30 + #else 31 + #define __efistub_global 32 + #endif 33 + 34 + extern bool __pure nokaslr(void); 35 + extern bool __pure is_quiet(void); 36 + extern bool __pure novamap(void); 31 37 32 38 extern __pure efi_system_table_t *efi_system_table(void); 33 39