linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 10295/10848] arch/x86/kernel/crash.c:232:12: warning: 'prepare_elf_headers' defined but not used
@ 2023-08-21 17:01 kernel test robot
  2023-08-21 18:02 ` Eric DeVolder
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2023-08-21 17:01 UTC (permalink / raw)
  To: Eric DeVolder
  Cc: oe-kbuild-all, Linux Memory Management List, Andrew Morton, Sourabh Jain

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   47d9bb711707d15b19fad18c8e2b4b027a264a3a
commit: f59d77dc3eea31329e70dbc9ba6fea9faa24829f [10295/10848] x86/crash: add x86 crash hotplug support
config: x86_64-randconfig-r024-20230821 (https://download.01.org/0day-ci/archive/20230822/202308220012.gipltORx-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230822/202308220012.gipltORx-lkp@intel.com/reproduce)

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/202308220012.gipltORx-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> arch/x86/kernel/crash.c:232:12: warning: 'prepare_elf_headers' defined but not used [-Wunused-function]
     232 | static int prepare_elf_headers(struct kimage *image, void **addr,
         |            ^~~~~~~~~~~~~~~~~~~


vim +/prepare_elf_headers +232 arch/x86/kernel/crash.c

dd5f726076cc763 Vivek Goyal     2014-08-08  230  
dd5f726076cc763 Vivek Goyal     2014-08-08  231  /* Prepare elf headers. Return addr and size */
dd5f726076cc763 Vivek Goyal     2014-08-08 @232  static int prepare_elf_headers(struct kimage *image, void **addr,
f59d77dc3eea313 Eric DeVolder   2023-08-14  233  					unsigned long *sz, unsigned long *nr_mem_ranges)
dd5f726076cc763 Vivek Goyal     2014-08-08  234  {
8d5f894a3108ac7 AKASHI Takahiro 2018-04-13  235  	struct crash_mem *cmem;
7c321eb2b843bf2 Lianbo Jiang    2019-11-08  236  	int ret;
dd5f726076cc763 Vivek Goyal     2014-08-08  237  
8d5f894a3108ac7 AKASHI Takahiro 2018-04-13  238  	cmem = fill_up_crash_elf_data();
8d5f894a3108ac7 AKASHI Takahiro 2018-04-13  239  	if (!cmem)
dd5f726076cc763 Vivek Goyal     2014-08-08  240  		return -ENOMEM;
dd5f726076cc763 Vivek Goyal     2014-08-08  241  
9eff303725da653 Borislav Petkov 2019-11-14  242  	ret = walk_system_ram_res(0, -1, cmem, prepare_elf64_ram_headers_callback);
cbe6601617302b0 AKASHI Takahiro 2018-04-13  243  	if (ret)
cbe6601617302b0 AKASHI Takahiro 2018-04-13  244  		goto out;
cbe6601617302b0 AKASHI Takahiro 2018-04-13  245  
cbe6601617302b0 AKASHI Takahiro 2018-04-13  246  	/* Exclude unwanted mem ranges */
8d5f894a3108ac7 AKASHI Takahiro 2018-04-13  247  	ret = elf_header_exclude_ranges(cmem);
cbe6601617302b0 AKASHI Takahiro 2018-04-13  248  	if (ret)
cbe6601617302b0 AKASHI Takahiro 2018-04-13  249  		goto out;
cbe6601617302b0 AKASHI Takahiro 2018-04-13  250  
f59d77dc3eea313 Eric DeVolder   2023-08-14  251  	/* Return the computed number of memory ranges, for hotplug usage */
f59d77dc3eea313 Eric DeVolder   2023-08-14  252  	*nr_mem_ranges = cmem->nr_ranges;
f59d77dc3eea313 Eric DeVolder   2023-08-14  253  
dd5f726076cc763 Vivek Goyal     2014-08-08  254  	/* By default prepare 64bit headers */
9eff303725da653 Borislav Petkov 2019-11-14  255  	ret =  crash_prepare_elf64_headers(cmem, IS_ENABLED(CONFIG_X86_64), addr, sz);
cbe6601617302b0 AKASHI Takahiro 2018-04-13  256  
cbe6601617302b0 AKASHI Takahiro 2018-04-13  257  out:
8d5f894a3108ac7 AKASHI Takahiro 2018-04-13  258  	vfree(cmem);
dd5f726076cc763 Vivek Goyal     2014-08-08  259  	return ret;
dd5f726076cc763 Vivek Goyal     2014-08-08  260  }
f59d77dc3eea313 Eric DeVolder   2023-08-14  261  #endif
dd5f726076cc763 Vivek Goyal     2014-08-08  262  

:::::: The code at line 232 was first introduced by commit
:::::: dd5f726076cc7639d9713b334c8c133f77c6757a kexec: support for kexec on panic using new system call

:::::: TO: Vivek Goyal <vgoyal@redhat.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


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

* Re: [linux-next:master 10295/10848] arch/x86/kernel/crash.c:232:12: warning: 'prepare_elf_headers' defined but not used
  2023-08-21 17:01 [linux-next:master 10295/10848] arch/x86/kernel/crash.c:232:12: warning: 'prepare_elf_headers' defined but not used kernel test robot
@ 2023-08-21 18:02 ` Eric DeVolder
  0 siblings, 0 replies; 2+ messages in thread
From: Eric DeVolder @ 2023-08-21 18:02 UTC (permalink / raw)
  To: kernel test robot
  Cc: oe-kbuild-all, Linux Memory Management List, Andrew Morton, Sourabh Jain



On 8/21/23 12:01, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   47d9bb711707d15b19fad18c8e2b4b027a264a3a
> commit: f59d77dc3eea31329e70dbc9ba6fea9faa24829f [10295/10848] x86/crash: add x86 crash hotplug support
> config: x86_64-randconfig-r024-20230821 (https://download.01.org/0day-ci/archive/20230822/202308220012.gipltORx-lkp@intel.com/config)
> compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
> reproduce: (https://download.01.org/0day-ci/archive/20230822/202308220012.gipltORx-lkp@intel.com/reproduce)
> 
> 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/202308220012.gipltORx-lkp@intel.com/
> 
> All warnings (new ones prefixed by >>):
> 
>>> arch/x86/kernel/crash.c:232:12: warning: 'prepare_elf_headers' defined but not used [-Wunused-function]
>       232 | static int prepare_elf_headers(struct kimage *image, void **addr,
>           |            ^~~~~~~~~~~~~~~~~~~
> 
> 

This has been fixed in a separate patch. See the thread:

https://lore.kernel.org/lkml/2dac3bf6-dc57-4e60-ba82-f3eab73e1d5c@oracle.com/

Thanks!
eric

> vim +/prepare_elf_headers +232 arch/x86/kernel/crash.c
> 
> dd5f726076cc763 Vivek Goyal     2014-08-08  230
> dd5f726076cc763 Vivek Goyal     2014-08-08  231  /* Prepare elf headers. Return addr and size */
> dd5f726076cc763 Vivek Goyal     2014-08-08 @232  static int prepare_elf_headers(struct kimage *image, void **addr,
> f59d77dc3eea313 Eric DeVolder   2023-08-14  233  					unsigned long *sz, unsigned long *nr_mem_ranges)
> dd5f726076cc763 Vivek Goyal     2014-08-08  234  {
> 8d5f894a3108ac7 AKASHI Takahiro 2018-04-13  235  	struct crash_mem *cmem;
> 7c321eb2b843bf2 Lianbo Jiang    2019-11-08  236  	int ret;
> dd5f726076cc763 Vivek Goyal     2014-08-08  237
> 8d5f894a3108ac7 AKASHI Takahiro 2018-04-13  238  	cmem = fill_up_crash_elf_data();
> 8d5f894a3108ac7 AKASHI Takahiro 2018-04-13  239  	if (!cmem)
> dd5f726076cc763 Vivek Goyal     2014-08-08  240  		return -ENOMEM;
> dd5f726076cc763 Vivek Goyal     2014-08-08  241
> 9eff303725da653 Borislav Petkov 2019-11-14  242  	ret = walk_system_ram_res(0, -1, cmem, prepare_elf64_ram_headers_callback);
> cbe6601617302b0 AKASHI Takahiro 2018-04-13  243  	if (ret)
> cbe6601617302b0 AKASHI Takahiro 2018-04-13  244  		goto out;
> cbe6601617302b0 AKASHI Takahiro 2018-04-13  245
> cbe6601617302b0 AKASHI Takahiro 2018-04-13  246  	/* Exclude unwanted mem ranges */
> 8d5f894a3108ac7 AKASHI Takahiro 2018-04-13  247  	ret = elf_header_exclude_ranges(cmem);
> cbe6601617302b0 AKASHI Takahiro 2018-04-13  248  	if (ret)
> cbe6601617302b0 AKASHI Takahiro 2018-04-13  249  		goto out;
> cbe6601617302b0 AKASHI Takahiro 2018-04-13  250
> f59d77dc3eea313 Eric DeVolder   2023-08-14  251  	/* Return the computed number of memory ranges, for hotplug usage */
> f59d77dc3eea313 Eric DeVolder   2023-08-14  252  	*nr_mem_ranges = cmem->nr_ranges;
> f59d77dc3eea313 Eric DeVolder   2023-08-14  253
> dd5f726076cc763 Vivek Goyal     2014-08-08  254  	/* By default prepare 64bit headers */
> 9eff303725da653 Borislav Petkov 2019-11-14  255  	ret =  crash_prepare_elf64_headers(cmem, IS_ENABLED(CONFIG_X86_64), addr, sz);
> cbe6601617302b0 AKASHI Takahiro 2018-04-13  256
> cbe6601617302b0 AKASHI Takahiro 2018-04-13  257  out:
> 8d5f894a3108ac7 AKASHI Takahiro 2018-04-13  258  	vfree(cmem);
> dd5f726076cc763 Vivek Goyal     2014-08-08  259  	return ret;
> dd5f726076cc763 Vivek Goyal     2014-08-08  260  }
> f59d77dc3eea313 Eric DeVolder   2023-08-14  261  #endif
> dd5f726076cc763 Vivek Goyal     2014-08-08  262
> 
> :::::: The code at line 232 was first introduced by commit
> :::::: dd5f726076cc7639d9713b334c8c133f77c6757a kexec: support for kexec on panic using new system call
> 
> :::::: TO: Vivek Goyal <vgoyal@redhat.com>
> :::::: CC: Linus Torvalds <torvalds@linux-foundation.org>
> 


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

end of thread, other threads:[~2023-08-21 18:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-21 17:01 [linux-next:master 10295/10848] arch/x86/kernel/crash.c:232:12: warning: 'prepare_elf_headers' defined but not used kernel test robot
2023-08-21 18:02 ` Eric DeVolder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox