tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: e4ad5a7cc835421f3f2799db98ef2f9d5143f076 commit: e467807275555a062593aa1e89f3201644ef0ea5 [2462/2462] efi/libstub: implement generic EFI zboot config: arm64-randconfig-003-20241121 (https://download.01.org/0day-ci/archive/20241122/202411220334.X00IT0yA-lkp@i...) compiler: aarch64-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241122/202411220334.X00IT0yA-lkp@i...)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot lkp@intel.com | Closes: https://lore.kernel.org/oe-kbuild-all/202411220334.X00IT0yA-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from drivers/firmware/efi/libstub/zboot.c:21: drivers/firmware/efi/libstub/../../../../lib/decompress_unlzo.c: In function 'parse_header':
drivers/firmware/efi/libstub/../../../../lib/decompress_unlzo.c:46:12: warning: variable 'level' set but not used [-Wunused-but-set-variable]
46 | u8 level = 0; | ^~~~~ drivers/firmware/efi/libstub/zboot.c: At top level: drivers/firmware/efi/libstub/zboot.c:162:1: warning: no previous prototype for 'efi_zboot_entry' [-Wmissing-prototypes] 162 | efi_zboot_entry(efi_handle_t handle, efi_system_table_t *systab) | ^~~~~~~~~~~~~~~
vim +/level +46 drivers/firmware/efi/libstub/../../../../lib/decompress_unlzo.c
7dd65feb6c603e Albin Tonnerre 2010-01-08 40 d97b07c54f34e8 Yinghai Lu 2014-08-08 41 STATIC inline long INIT parse_header(u8 *input, long *skip, long in_len) 7dd65feb6c603e Albin Tonnerre 2010-01-08 42 { 7dd65feb6c603e Albin Tonnerre 2010-01-08 43 int l; 7dd65feb6c603e Albin Tonnerre 2010-01-08 44 u8 *parse = input; 5a3f81a7029daf Lasse Collin 2011-01-12 45 u8 *end = input + in_len; 7dd65feb6c603e Albin Tonnerre 2010-01-08 @46 u8 level = 0; 7dd65feb6c603e Albin Tonnerre 2010-01-08 47 u16 version; 7dd65feb6c603e Albin Tonnerre 2010-01-08 48 5a3f81a7029daf Lasse Collin 2011-01-12 49 /* 5a3f81a7029daf Lasse Collin 2011-01-12 50 * Check that there's enough input to possibly have a valid header. 5a3f81a7029daf Lasse Collin 2011-01-12 51 * Then it is possible to parse several fields until the minimum 5a3f81a7029daf Lasse Collin 2011-01-12 52 * size may have been used. 5a3f81a7029daf Lasse Collin 2011-01-12 53 */ 5a3f81a7029daf Lasse Collin 2011-01-12 54 if (in_len < HEADER_SIZE_MIN) 5a3f81a7029daf Lasse Collin 2011-01-12 55 return 0; 5a3f81a7029daf Lasse Collin 2011-01-12 56 7dd65feb6c603e Albin Tonnerre 2010-01-08 57 /* read magic: 9 first bits */ 7dd65feb6c603e Albin Tonnerre 2010-01-08 58 for (l = 0; l < 9; l++) { 7dd65feb6c603e Albin Tonnerre 2010-01-08 59 if (*parse++ != lzop_magic[l]) 7dd65feb6c603e Albin Tonnerre 2010-01-08 60 return 0; 7dd65feb6c603e Albin Tonnerre 2010-01-08 61 } 7dd65feb6c603e Albin Tonnerre 2010-01-08 62 /* get version (2bytes), skip library version (2), 7dd65feb6c603e Albin Tonnerre 2010-01-08 63 * 'need to be extracted' version (2) and 7dd65feb6c603e Albin Tonnerre 2010-01-08 64 * method (1) */ 7dd65feb6c603e Albin Tonnerre 2010-01-08 65 version = get_unaligned_be16(parse); 7dd65feb6c603e Albin Tonnerre 2010-01-08 66 parse += 7; 7dd65feb6c603e Albin Tonnerre 2010-01-08 67 if (version >= 0x0940) 7dd65feb6c603e Albin Tonnerre 2010-01-08 68 level = *parse++; 7dd65feb6c603e Albin Tonnerre 2010-01-08 69 if (get_unaligned_be32(parse) & HEADER_HAS_FILTER) 7dd65feb6c603e Albin Tonnerre 2010-01-08 70 parse += 8; /* flags + filter info */ 7dd65feb6c603e Albin Tonnerre 2010-01-08 71 else 7dd65feb6c603e Albin Tonnerre 2010-01-08 72 parse += 4; /* flags */ 7dd65feb6c603e Albin Tonnerre 2010-01-08 73 5a3f81a7029daf Lasse Collin 2011-01-12 74 /* 5a3f81a7029daf Lasse Collin 2011-01-12 75 * At least mode, mtime_low, filename length, and checksum must 5a3f81a7029daf Lasse Collin 2011-01-12 76 * be left to be parsed. If also mtime_high is present, it's OK 5a3f81a7029daf Lasse Collin 2011-01-12 77 * because the next input buffer check is after reading the 5a3f81a7029daf Lasse Collin 2011-01-12 78 * filename length. 5a3f81a7029daf Lasse Collin 2011-01-12 79 */ 5a3f81a7029daf Lasse Collin 2011-01-12 80 if (end - parse < 8 + 1 + 4) 5a3f81a7029daf Lasse Collin 2011-01-12 81 return 0; 5a3f81a7029daf Lasse Collin 2011-01-12 82 7dd65feb6c603e Albin Tonnerre 2010-01-08 83 /* skip mode and mtime_low */ 7dd65feb6c603e Albin Tonnerre 2010-01-08 84 parse += 8; 7dd65feb6c603e Albin Tonnerre 2010-01-08 85 if (version >= 0x0940) 7dd65feb6c603e Albin Tonnerre 2010-01-08 86 parse += 4; /* skip mtime_high */ 7dd65feb6c603e Albin Tonnerre 2010-01-08 87 7dd65feb6c603e Albin Tonnerre 2010-01-08 88 l = *parse++; 7dd65feb6c603e Albin Tonnerre 2010-01-08 89 /* don't care about the file name, and skip checksum */ 5a3f81a7029daf Lasse Collin 2011-01-12 90 if (end - parse < l + 4) 5a3f81a7029daf Lasse Collin 2011-01-12 91 return 0; 7dd65feb6c603e Albin Tonnerre 2010-01-08 92 parse += l + 4; 7dd65feb6c603e Albin Tonnerre 2010-01-08 93 7dd65feb6c603e Albin Tonnerre 2010-01-08 94 *skip = parse - input; 7dd65feb6c603e Albin Tonnerre 2010-01-08 95 return 1; 7dd65feb6c603e Albin Tonnerre 2010-01-08 96 } 7dd65feb6c603e Albin Tonnerre 2010-01-08 97
:::::: The code at line 46 was first introduced by commit :::::: 7dd65feb6c603e13eba501c34c662259ab38e70e lib: add support for LZO-compressed kernels
:::::: TO: Albin Tonnerre albin.tonnerre@free-electrons.com :::::: CC: Linus Torvalds torvalds@linux-foundation.org